Skip to content

Commit 24525b1

Browse files
authored
Merge branch 'master' into master
2 parents 3e59351 + 2d1e4bf commit 24525b1

File tree

72 files changed

+1362
-1865
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+1362
-1865
lines changed

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@ tests export-ignore
22
.gitattributes export-ignore
33
.github export-ignore
44
.gitignore export-ignore
5+
.pint.json export-ignore
56
.scrutinizer.yml export-ignore
67
.styleci.yml export-ignore
78
.travis.yml export-ignore
89
CHANGELOG.md export-ignore
910
CONTRIBUTING.md export-ignore
1011
phpunit.xml export-ignore
1112
README.md export-ignore
13+
phpstan* export-ignore
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Fix PHP code style issues
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- '**.php'
7+
- '.github/workflows/fix-php-code-style-issues.yml'
8+
- '.pint.json'
9+
10+
jobs:
11+
php-code-styling:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
18+
- name: Fix PHP code style issues
19+
uses: aglipanci/laravel-pint-action@v2
20+
with:
21+
configPath: ".pint.json"
22+
23+
- name: Commit changes
24+
uses: stefanzweifel/git-auto-commit-action@v5
25+
with:
26+
commit_message: Fix styling

.github/workflows/phpstan.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: PHPStan
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- '**.php'
7+
- 'phpstan.neon.dist'
8+
9+
jobs:
10+
phpstan:
11+
name: phpstan
12+
runs-on: ubuntu-latest
13+
timeout-minutes: 15
14+
env:
15+
COMPOSER_NO_INTERACTION: 1
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Setup PHP
20+
uses: shivammathur/setup-php@v2
21+
with:
22+
php-version: 8.4
23+
coverage: none
24+
25+
- name: Install composer dependencies
26+
uses: ramsey/composer-install@v3
27+
28+
- name: Install larastan
29+
run: |
30+
composer require "larastan/larastan" --no-update
31+
composer update --prefer-dist --no-suggest
32+
33+
- name: Run PHPStan
34+
run: ./vendor/bin/phpstan --error-format=github

.github/workflows/run-tests.yml

Lines changed: 13 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -2,57 +2,29 @@ name: run-tests
22

33
on:
44
push:
5-
branches: [master]
6-
pull_request:
7-
branches: [master]
5+
branches:
6+
- '*'
87

98
jobs:
109
run-tests:
1110
runs-on: ubuntu-latest
11+
timeout-minutes: 15
12+
env:
13+
COMPOSER_NO_INTERACTION: 1
1214
strategy:
1315
fail-fast: false
1416
matrix:
15-
php: [7.4, 8.0, 8.1, 8.2, 8.3]
16-
laravel: [ 11.*, 10.*, 9.*, 8.*, 7.* ]
17+
php: [ 8.2, 8.3, 8.4 ]
18+
laravel: [ 11.*, 12.* ]
1719
include:
20+
- laravel: 12.*
21+
testbench: 10.*
1822
- laravel: 11.*
1923
testbench: 9.*
20-
- laravel: 10.*
21-
testbench: 8.*
22-
- laravel: 9.*
23-
testbench: 7.*
24-
- laravel: 8.*
25-
testbench: 6.*
26-
- laravel: 7.*
27-
testbench: 5.*
28-
exclude:
29-
- laravel: 11.*
30-
php: 8.1
31-
- laravel: 11.*
32-
php: 8.0
33-
- laravel: 11.*
34-
php: 7.4
35-
- laravel: 10.*
36-
php: 7.4
37-
- laravel: 10.*
38-
php: 8.0
39-
- laravel: 9.*
40-
php: 7.4
41-
- laravel: 8.*
42-
php: 8.3
43-
- laravel: 7.*
44-
php: 8.1
45-
- laravel: 7.*
46-
php: 8.2
47-
- laravel: 7.*
48-
php: 8.3
4924

5025
name: PHP${{ matrix.php }} - Laravel${{ matrix.laravel }} - ${{ matrix.dependency-version }}
5126

5227
steps:
53-
- name: Update apt
54-
run: sudo apt-get update --fix-missing
55-
5628
- name: Checkout code
5729
uses: actions/checkout@v4
5830

@@ -65,11 +37,11 @@ jobs:
6537

6638
- name: Install dependencies
6739
run: |
68-
composer require "illuminate/console:${{ matrix.laravel }}" "illuminate/database:${{ matrix.laravel }}" "illuminate/filesystem:${{ matrix.laravel }}" "nesbot/carbon:^2.62.1" --no-interaction --no-update
69-
composer require "orchestra/testbench:${{ matrix.testbench }}" --dev --no-interaction --no-update
70-
composer update --prefer-dist --no-interaction --no-suggest
40+
composer require "illuminate/console:${{ matrix.laravel }}" "illuminate/database:${{ matrix.laravel }}" "illuminate/filesystem:${{ matrix.laravel }}" --no-update
41+
composer require "orchestra/testbench:${{ matrix.testbench }}" --dev --no-update
42+
composer update --prefer-dist --no-suggest
7143
7244
- name: Execute tests
7345
run: |
7446
vendor/bin/phpunit
75-
vendor/bin/phpunit tests/Unit/AuditTest.php --group command-line-url-resolver
47+
vendor/bin/phpunit tests/Unit/AuditTest.php --group command-line-url-resolver

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@
22
/vendor
33
composer.lock
44
.vscode
5+
.phpunit.cache
56
.phpunit.result.cache
7+
/build/phpstan

.pint.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"preset": "laravel",
3+
"verbose": false,
4+
"test": false,
5+
"dry": false,
6+
"ignore": [
7+
"vendor"
8+
],
9+
"remove": [],
10+
"config": {
11+
"braces": {
12+
"allow_single_line_closure": true
13+
}
14+
}
15+
}

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
## v13.0.0
1+
## Note that changelogs not listed here are included in the [releases](https://github.com/owen-it/laravel-auditing/releases).
2+
3+
---
4+
5+
## v13.0.0 (2022-03-02)
26

37
### Added
48

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<a href="https://discord.gg/csD9ysg"><img src="https://img.shields.io/badge/chat-on%20discord-7289DA.svg" alt="Chat"></a>
1313
</p>
1414

15-
This package will help you understand changes in your Eloquent models, by providing information about possible discrepancies and anomalies that could indicate business concerns or suspect activities.
15+
This package will help you understand changes in your Eloquent models, by providing information about possible discrepancies and anomalies that could indicate business concerns or suspect activities.
1616

1717
Laravel Auditing allows you to keep a history of model changes by simply using a trait. Retrieving the audited data is straightforward, making it possible to display it in various ways.
1818

@@ -26,7 +26,8 @@ Thank you for choosing OwenIt\LaravelAuditing!
2626

2727
Version | Illuminate | Status | PHP Version
2828
:----------|:---------------|:------------------------|:------------
29-
13.x | 7.x.x - 11.x.x | Active support :rocket: | > = 7.3 \| 8.0
29+
14.x | 11.x.x - 12.x.x | Active support :rocket: | > = 8.2
30+
13.x | 7.x.x - 11.x.x | End of life | > = 7.3 \| 8.0
3031
12.x | 6.x.x - 9.x.x | End of life | > = 7.3 \| 8.0
3132
11.x | 5.8.x - 8.x.x | End of life | > = 7.3
3233
10.x | 5.8.x - 7.x.x | End of life | > = 7.2.5

composer.json

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "owen-it/laravel-auditing",
3-
"description": "Audit changes of your Eloquent models in Laravel/Lumen",
3+
"description": "Audit changes of your Eloquent models in Laravel",
44
"keywords": [
55
"accountability",
66
"audit",
@@ -39,17 +39,16 @@
3939
}
4040
],
4141
"require": {
42-
"php": "^7.3|^8.0",
43-
"illuminate/console": "^7.0|^8.0|^9.0|^10.0|^11.0",
44-
"illuminate/database": "^7.0|^8.0|^9.0|^10.0|^11.0",
45-
"illuminate/filesystem": "^7.0|^8.0|^9.0|^10.0|^11.0",
46-
"ext-json": "*"
42+
"php": "^8.2",
43+
"ext-json": "*",
44+
"illuminate/console": "^11.0|^12.0",
45+
"illuminate/database": "^11.0|^12.0",
46+
"illuminate/filesystem": "^11.0|^12.0"
4747
},
4848
"require-dev": {
49-
"phpunit/phpunit": "^9.6|^10.5|^11.0",
50-
"mockery/mockery": "^1.0",
51-
"orchestra/testbench": "^5.0|^6.0|^7.0|^8.0|^9.0",
52-
"laravel/legacy-factories": "*"
49+
"mockery/mockery": "^1.5.1",
50+
"orchestra/testbench": "^9.0|^10.0",
51+
"phpunit/phpunit": "^11.0"
5352
},
5453
"autoload": {
5554
"psr-4": {
@@ -61,19 +60,21 @@
6160
"OwenIt\\Auditing\\Tests\\": "tests/"
6261
}
6362
},
64-
"suggest": {
65-
"irazasyed/larasupport": "Needed to publish the package configuration in Lumen"
66-
},
6763
"extra": {
6864
"branch-alias": {
69-
"dev-master": "v13-dev"
65+
"dev-master": "v14-dev"
7066
},
7167
"laravel": {
7268
"providers": [
7369
"OwenIt\\Auditing\\AuditingServiceProvider"
7470
]
7571
}
7672
},
73+
"scripts": {
74+
"test": "phpunit",
75+
"format": "composer require --dev laravel/pint --quiet && pint --config .pint.json && composer remove --dev laravel/pint --no-update",
76+
"analyse": "composer require --dev larastan/larastan --quiet && phpstan analyse && composer remove --dev larastan/larastan --no-update"
77+
},
7778
"minimum-stability": "dev",
7879
"prefer-stable": true
7980
}

config/audit.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@
2424
|
2525
*/
2626

27-
'user' => [
27+
'user' => [
2828
'morph_prefix' => 'user',
29-
'guards' => [
29+
'guards' => [
3030
'web',
31-
'api'
31+
'api',
3232
],
33-
'resolver' => OwenIt\Auditing\Resolvers\UserResolver::class
33+
'resolver' => OwenIt\Auditing\Resolvers\UserResolver::class,
3434
],
3535

3636
/*
@@ -44,7 +44,7 @@
4444
'resolvers' => [
4545
'ip_address' => OwenIt\Auditing\Resolvers\IpAddressResolver::class,
4646
'user_agent' => OwenIt\Auditing\Resolvers\UserAgentResolver::class,
47-
'url' => OwenIt\Auditing\Resolvers\UrlResolver::class,
47+
'url' => OwenIt\Auditing\Resolvers\UrlResolver::class,
4848
],
4949

5050
/*
@@ -60,7 +60,7 @@
6060
'created',
6161
'updated',
6262
'deleted',
63-
'restored'
63+
'restored',
6464
],
6565

6666
/*
@@ -101,9 +101,9 @@
101101
|
102102
*/
103103

104-
'empty_values' => true,
104+
'empty_values' => true,
105105
'allowed_empty_values' => [
106-
'retrieved'
106+
'retrieved',
107107
],
108108

109109
/*
@@ -164,7 +164,7 @@
164164

165165
'drivers' => [
166166
'database' => [
167-
'table' => 'audits',
167+
'table' => 'audits',
168168
'connection' => null,
169169
],
170170
],
@@ -179,10 +179,10 @@
179179
*/
180180

181181
'queue' => [
182-
'enable' => false,
182+
'enable' => false,
183183
'connection' => 'sync',
184-
'queue' => 'default',
185-
'delay' => 0,
184+
'queue' => 'default',
185+
'delay' => 0,
186186
],
187187

188188
/*

0 commit comments

Comments
 (0)