Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/origin/master' into v4
Browse files Browse the repository at this point in the history
# Conflicts:
#	CHANGELOG.md
  • Loading branch information
Gummibeer committed Sep 16, 2020
2 parents e0b6249 + 9790bfb commit 8ff2cfc
Show file tree
Hide file tree
Showing 25 changed files with 452 additions and 133 deletions.
File renamed without changes.
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
github: spatie
custom: https://spatie.be/open-source/support-us
36 changes: 36 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
name: "🐛 Bug Report"
about: Create a bug report to help us improve
title: ''
labels: bug
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Things needed to reproduce the error.
eg: Configuration, Migration, Model, Controller/Command

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Versions (please complete the following information)**
- PHP:
- Database:
- Laravel:
- Package:

**Additional context**
Add any other context about the problem here.

**Exception**
The thrown exception message.

**Stack Trace**
The full stack trace of the thrown exception.
15 changes: 15 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
blank_issues_enabled: false
contact_links:
- name: 🚀 Feature Request
url: https://github.com/spatie/laravel-activitylog/discussions/new?category_id=4507850
about: Share ideas for new features
- name: 🙏 Ask a Question
url: https://github.com/spatie/laravel-activitylog/discussions/new?category_id=4507849
about: Ask the community for help
- name: 💖 Share some love
url: https://github.com/spatie/laravel-activitylog/discussions/new?category_id=4507852
about: Share gratitude with the team
- name: 🚨 Report Security Vulnerability
url: https://github.com/spatie/laravel-activitylog#security
about: Please report security vulnerabilities by email to [email protected]

22 changes: 22 additions & 0 deletions .github/workflows/composer-normalize.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: normalize composer.json

on:
push:
paths:
- 'composer.json'

jobs:
normalize:
runs-on: ubuntu-latest
steps:
- name: Git checkout
uses: actions/checkout@v2

- name: normalize composer.json
run: |
composer global require ergebnis/composer-normalize
composer normalize
- uses: stefanzweifel/[email protected]
with:
commit_message: normalize composer.json
19 changes: 0 additions & 19 deletions .github/workflows/deploy-docs.yml

This file was deleted.

23 changes: 23 additions & 0 deletions .github/workflows/php-cs-fixer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Check & fix styling

on: [ push ]

jobs:
php-cs-fixer:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}

- name: Run PHP CS Fixer
uses: docker://oskarstark/php-cs-fixer-ga
with:
args: --config=.php_cs.dist --allow-risky=yes

- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Fix styling
70 changes: 38 additions & 32 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,48 +4,54 @@ on:
push:
pull_request:
schedule:
- cron: '0 0 * * *'
- cron: '0 0 * * *'

jobs:
test:
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
php: [7.4, 7.3, 7.2]
laravel: [7.*, 6.*]
dependency-version: [prefer-lowest, prefer-stable]
os: [ubuntu-latest, windows-latest]
php: [ 7.4, 7.3, 7.2 ]
laravel: [ 8.*, 7.*, 6.* ]
dependency-version: [ prefer-lowest, prefer-stable ]
os: [ ubuntu-latest, windows-latest ]
include:
- laravel: 7.*
testbench: 5.*
- laravel: 6.*
testbench: 4.*
- laravel: 8.*
testbench: 6.*
- laravel: 7.*
testbench: 5.*
- laravel: 6.*
testbench: 4.*
exclude:
- laravel: 8.*
php: 7.2

name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} - ${{ matrix.os }}

steps:
- name: Checkout code
uses: actions/checkout@v1

- name: Cache dependencies
uses: actions/cache@v1
with:
path: ~/.composer/cache/files
key: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}

- name: Setup PHP
uses: shivammathur/setup-php@v1
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, mysql, mysqli, pdo_mysql, bcmath, soap, intl, gd, exif, iconv, imagick
coverage: none

- name: Install dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest
- name: Execute tests
run: vendor/bin/phpunit
- name: Checkout code
uses: actions/checkout@v2

- name: Cache dependencies
uses: actions/cache@v2
with:
path: ~/.composer/cache/files
key: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, mysql, mysqli, pdo_mysql, bcmath, soap, intl, gd, exif, iconv, imagick
coverage: none

- name: Install dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest
- name: Execute tests
run: vendor/bin/phpunit

17 changes: 17 additions & 0 deletions .github/workflows/stale-issues.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: "Close stale issues"
on:
schedule:
- cron: "0 0 * * *"

jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'This issue is stale because it has been open 21 days with no activity. Remove stale label or comment or this will be closed in 7 days'
stale-issue-label: 'stale'
exempt-issue-labels: 'bug,enhancement,help wanted,next release,revisit for next major version'
days-before-stale: 21
days-before-close: 7
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ build
composer.lock
vendor
.phpunit.result.cache
.php_cs.cache

37 changes: 37 additions & 0 deletions .php_cs.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?php

$finder = Symfony\Component\Finder\Finder::create()
->notPath('bootstrap/*')
->notPath('storage/*')
->notPath('resources/view/mail/*')
->in([
__DIR__ . '/src',
__DIR__ . '/tests',
])
->name('*.php')
->notName('*.blade.php')
->ignoreDotFiles(true)
->ignoreVCS(true);

return PhpCsFixer\Config::create()
->setRules([
'@PSR2' => true,
'array_syntax' => ['syntax' => 'short'],
'ordered_imports' => ['sortAlgorithm' => 'alpha'],
'no_unused_imports' => true,
'not_operator_with_successor_space' => true,
'trailing_comma_in_multiline_array' => true,
'phpdoc_scalar' => true,
'unary_operator_spaces' => true,
'binary_operator_spaces' => true,
'blank_line_before_statement' => [
'statements' => ['break', 'continue', 'declare', 'return', 'throw', 'try'],
],
'phpdoc_single_line_var_spacing' => true,
'phpdoc_var_without_name' => true,
'method_argument_space' => [
'on_multiline' => 'ensure_fully_multiline',
'keep_multiple_spaces_after_comma' => true,
]
])
->setFinder($finder);
23 changes: 0 additions & 23 deletions .scrutinizer.yml

This file was deleted.

1 change: 0 additions & 1 deletion .styleci.yml

This file was deleted.

20 changes: 19 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,25 @@

All notable changes to `spatie/laravel-activitylog` will be documented in this file

## 3.14.0 - 2020-03-23
## 3.15.0 - 2020-09-14

- Add multiple/chained relation attribute logging support - [#784](https://github.com/spatie/laravel-activitylog/pull/784)

## 3.14.3 - 2020-09-09

- Add support for Laravel 8

## 3.14.2 - 2020-05-19

- fix `retrieved` event logging

## 3.14.1 - 2020-03-23

- revert breaking changes in `v3.14.0`

## 3.14.0 - 2020-03-23 - BC

Please use `v3.14.1` instead - this release is breaking because of the new column. There is also a `v4.0.0-rc.1` release that equals to this one.

- add `\Spatie\Activitylog\ActivityLogger::event()` method and column [#702](https://github.com/spatie/laravel-activitylog/pull/702)

Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@

[![Latest Version on Packagist](https://img.shields.io/packagist/v/spatie/laravel-activitylog.svg?style=flat-square)](https://packagist.org/packages/spatie/laravel-activitylog)
![GitHub Workflow Status](https://img.shields.io/github/workflow/status/spatie/laravel-activitylog/run-tests?label=tests)
[![Code coverage](https://scrutinizer-ci.com/g/spatie/laravel-activitylog/badges/coverage.png)](https://scrutinizer-ci.com/g/spatie/laravel-activitylog)
[![Quality Score](https://img.shields.io/scrutinizer/g/spatie/laravel-activitylog.svg?style=flat-square)](https://scrutinizer-ci.com/g/spatie/laravel-activitylog)
[![StyleCI](https://styleci.io/repos/61802818/shield)](https://styleci.io/repos/61802818)
![Check & fix styling](https://github.com/spatie/laravel-activitylog/workflows/Check%20&%20fix%20styling/badge.svg)
[![Total Downloads](https://img.shields.io/packagist/dt/spatie/laravel-activitylog.svg?style=flat-square)](https://packagist.org/packages/spatie/laravel-activitylog)

The `spatie/laravel-activitylog` package provides easy to use functions to log the activities of the users of your app. It can also automatically log model events.
The `spatie/laravel-activitylog` package provides easy to use functions to log the activities of the users of your app. It can also automatically log model events.
The Package stores all activity in the `activity_log` table.

Here's a demo of how you can use it:
Expand All @@ -29,7 +27,7 @@ activity()
->causedBy($user)
->withProperties(['customProperty' => 'customValue'])
->log('Look, I logged something');

$lastLoggedActivity = Activity::all()->last();

$lastLoggedActivity->subject; //returns an instance of an eloquent model
Expand Down Expand Up @@ -69,7 +67,11 @@ Calling `$activity->changes()` will return this array:

## Support us

We invest a lot of resources into creating [best in class open source packages](https://spatie.be/open-source). You can support us by [buying one of our paid products](https://spatie.be/open-source/support-us).
Learn how to create a package like this one, by watching our premium video course:

[![Laravel Package training](https://spatie.be/github/package-training.jpg)](https://laravelpackage.training)

We invest a lot of resources into creating [best in class open source packages](https://spatie.be/open-source). You can support us by [buying one of our paid products](https://spatie.be/open-source/support-us).

We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on [our contact page](https://spatie.be/about-us). We publish all received postcards on [our virtual postcard wall](https://spatie.be/open-source/postcards).

Expand All @@ -80,7 +82,6 @@ Find yourself stuck using the package? Found a bug? Do you have general question

If you've found a security issue please mail [[email protected]](mailto:[email protected]) instead of using the issue tracker.


## Installation

You can install the package via composer:
Expand Down Expand Up @@ -173,7 +174,6 @@ Please see [CHANGELOG](CHANGELOG.md) for more information about recent changes.

Please see [UPGRADING](UPGRADING.md) for details.


## Testing

``` bash
Expand Down
Loading

0 comments on commit 8ff2cfc

Please sign in to comment.