Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
34af6e1
cut laravel 7.x support and thus legacy factories
MortenDHansen Mar 11, 2023
e883a7a
Change legacy factories in tests
MortenDHansen Mar 11, 2023
1f65adf
I am pretty sure this test was wrong.
MortenDHansen Mar 11, 2023
0335336
Change use of legacy factories in unit tests
MortenDHansen Mar 11, 2023
d65cdaf
Add php-cs-fixer psr-12
MortenDHansen Mar 11, 2023
75064d1
Add php-cs-fixer psr-12
MortenDHansen Mar 11, 2023
1b5b2f7
Merge remote-tracking branch 'origin/master' into v14-dev
MortenDHansen Mar 13, 2023
1e57cc2
unused import ..
MortenDHansen Mar 13, 2023
6fcf3b4
Its a PSR thing.
MortenDHansen Mar 13, 2023
62df551
Restructure
MortenDHansen Mar 13, 2023
f9cf1bb
Restructure
MortenDHansen Mar 14, 2023
e3d3307
Restructure
MortenDHansen Mar 14, 2023
afec870
dep bump
MortenDHansen Mar 14, 2023
c264fd6
Move transition to concern
MortenDHansen Mar 14, 2023
f49ab23
Pull audit pivot to concern
MortenDHansen Mar 14, 2023
fc2acee
Removed 7.x support, and thus no need for handling the differend asse…
MortenDHansen Mar 16, 2023
cd5fd71
Merge remote-tracking branch 'origin/master' into v14-dev
MortenDHansen Mar 16, 2023
39f1b1b
Cut support for laravel 7 and php 7
MortenDHansen Mar 16, 2023
1ab9e38
Cut support for laravel 7 and php 7
MortenDHansen Mar 16, 2023
88e416d
Cut laravel 8 (end of life)
MortenDHansen Mar 16, 2023
1ba115a
Laravel 10 requires php 8.1
MortenDHansen Mar 16, 2023
aaeeafc
Remove deprecated contracts
MortenDHansen Mar 17, 2023
66b3ec0
Test adding PHPStan to mergeflow
MortenDHansen Mar 24, 2023
81fd21c
Create phpstan-baseline.neon
erikn69 Mar 24, 2023
b4983da
Test adding Larastan
erikn69 Mar 24, 2023
0a77639
Merge pull request #811 from erikn69/patch-4
MortenDHansen Mar 28, 2023
3c8c07f
Merge remote-tracking branch 'origin/master' into adding-phpstan-to-d…
MortenDHansen Mar 28, 2023
f8d790b
PhpStan new workflow
erikn69 Mar 28, 2023
a1f88ea
Add pint workflow
erikn69 Mar 28, 2023
b90081d
Use anonymous migrations
erikn69 Mar 28, 2023
d41c45e
Merge pull request #814 from erikn69/patch-8
MortenDHansen Mar 29, 2023
a2c5a84
Merge pull request #813 from erikn69/patch-7
MortenDHansen Mar 29, 2023
fd3fdf1
Merge pull request #812 from erikn69/patch-6
MortenDHansen Mar 29, 2023
13eeedb
Merge remote-tracking branch 'origin/v14-dev' into v14-dev
MortenDHansen Mar 29, 2023
425414a
Merge remote-tracking branch 'origin/master' into v14-dev
MortenDHansen Mar 29, 2023
4547f66
Fix styling
MortenDHansen Mar 29, 2023
0c6a614
Merge remote-tracking branch 'origin/v14-dev' into adding-phpstan-to-…
MortenDHansen Mar 29, 2023
58ee7aa
Fix styling
MortenDHansen Mar 29, 2023
26f2f59
Merge remote-tracking branch 'origin/v14-dev' into adding-phpstan-to-…
MortenDHansen Mar 29, 2023
97f446a
Merge remote-tracking branch 'origin/adding-phpstan-to-deployflow' in…
MortenDHansen Mar 29, 2023
9bdb362
Remove publish on lumen
erikn69 Mar 29, 2023
85ffbf6
Update phpstan-baseline.neon
erikn69 Mar 29, 2023
dc05755
Merge pull request #816 from erikn69/patch-11
MortenDHansen Mar 30, 2023
cfe2855
Merge pull request #815 from erikn69/patch-10
MortenDHansen Mar 30, 2023
9cb3b87
Merge pull request #810 from owen-it/adding-phpstan-to-deployflow
MortenDHansen Mar 30, 2023
7f1f218
Fix Called 'slice' on collection, instead of query
erikn69 Mar 30, 2023
6a311c0
Revert "Remove publishing on lumen"
erikn69 Mar 30, 2023
43bdc1c
Merge pull request #818 from erikn69/revert-816-patch-11
MortenDHansen Mar 31, 2023
9e9efd3
Merge pull request #817 from erikn69/patch-12
MortenDHansen Apr 21, 2023
eadb80b
Fix styling
MortenDHansen Apr 21, 2023
a04093f
Fix preg_match() Passing null to parameter 2 (#825)
angeljqv Jun 19, 2023
6d53320
Merge v13 fixes into v14 branch
erikn69 Aug 23, 2023
11d56a4
Merge pull request #849 from erikn69/port-831
MortenDHansen Aug 24, 2023
72f7f16
Fix styling
MortenDHansen Aug 24, 2023
e2f6e1a
Merge remote-tracking branch 'origin/master' into v14-dev
MortenDHansen Oct 10, 2023
9d0439c
Fix factory reference
MortenDHansen Oct 10, 2023
86389e9
Fix styling
MortenDHansen Oct 10, 2023
e85612f
Merge remote-tracking branch 'origin/master' into v14-dev
MortenDHansen Dec 15, 2023
6473980
Rearrange after merge
MortenDHansen Dec 15, 2023
ea63b50
Tests passing after merge
MortenDHansen Dec 15, 2023
951128d
Fix styling
MortenDHansen Dec 15, 2023
28d40d4
Set abstract where concern has dependency
MortenDHansen Dec 15, 2023
f8646fc
wip
MortenDHansen Dec 15, 2023
6042664
Fix styling
MortenDHansen Dec 15, 2023
595c6cd
Bump github actions (#889)
erikn69 Dec 31, 2023
fa84806
♻️ revert concerns to highlight changes
willpower232 Dec 24, 2024
30eee38
🔧 update phpstan and lint
willpower232 Dec 24, 2024
f037526
🔧 rm annoying
willpower232 Dec 24, 2024
f232d27
🔧 able to run tests in unfortunate branch combinations
willpower232 Dec 24, 2024
0639540
🚧 just run the tests please
willpower232 Dec 24, 2024
42e5ed0
fixup! 🔧 update phpstan and lint
willpower232 Dec 24, 2024
caae912
🚨 first is actually nullable
willpower232 Dec 24, 2024
27ce73a
Merge remote-tracking branch 'origin/master' into v14-catchup
willpower232 Dec 24, 2024
2d6f442
🐛 void function does not return
willpower232 Dec 24, 2024
bac86a5
🐛 incorrect assert
willpower232 Dec 24, 2024
25776eb
🔧 rm remaining ancient factory references
willpower232 Dec 24, 2024
5d43c4a
🐛 more fix assert
willpower232 Dec 24, 2024
d59d7fb
🚨 audit should not have a factory
willpower232 Dec 24, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ CHANGELOG.md export-ignore
CONTRIBUTING.md export-ignore
phpunit.xml export-ignore
README.md export-ignore
phpstan* export-ignore
.php-cs-fixer.dist.php export-ignore
26 changes: 26 additions & 0 deletions .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: PHPStan

on:
push:
paths:
- '**.php'
- 'phpstan.neon'

jobs:
phpstan:
name: phpstan
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.3
coverage: none

- name: Install composer dependencies
uses: ramsey/composer-install@v2

- name: Run PHPStan
run: ./vendor/bin/phpstan --error-format=github
34 changes: 6 additions & 28 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,63 +2,41 @@ name: run-tests

on:
push:
branches: [master]
pull_request:
branches: [master]
branches:
- '*'

jobs:
run-tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: [7.4, 8.0, 8.1, 8.2, 8.3, 8.4]
laravel: [ 11.*, 10.*, 9.*, 8.*, 7.* ]
php: [ 8.0, 8.1, 8.2, 8.3, 8.4 ]
laravel: [ 11.*, 10.*, 9.* ]
include:
- laravel: 11.*
testbench: 9.*
- laravel: 10.*
testbench: 8.*
- laravel: 9.*
testbench: 7.*
- laravel: 8.*
testbench: 6.*
- laravel: 7.*
testbench: 5.*
exclude:
- laravel: 11.*
php: 8.1
- laravel: 11.*
php: 8.0
- laravel: 11.*
php: 7.4
- laravel: 10.*
php: 7.4
- laravel: 10.*
php: 8.0
- laravel: 9.*
php: 7.4
- laravel: 9.*
php: 8.4
- laravel: 8.*
php: 8.3
- laravel: 8.*
php: 8.4
- laravel: 7.*
php: 8.1
- laravel: 7.*
php: 8.2
- laravel: 7.*
php: 8.3
- laravel: 7.*
php: 8.4

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

steps:
- name: Update apt
run: sudo apt-get update --fix-missing

- name: Checkout code
uses: actions/checkout@v4

Expand All @@ -71,11 +49,11 @@ jobs:

- name: Install dependencies
run: |
composer require "illuminate/console:${{ matrix.laravel }}" "illuminate/database:${{ matrix.laravel }}" "illuminate/filesystem:${{ matrix.laravel }}" "nesbot/carbon:^2.62.1" --no-interaction --no-update
composer require "illuminate/console:${{ matrix.laravel }}" "illuminate/database:${{ matrix.laravel }}" "illuminate/filesystem:${{ matrix.laravel }}" --no-interaction --no-update
composer require "orchestra/testbench:${{ matrix.testbench }}" --dev --no-interaction --no-update
composer update --prefer-dist --no-interaction --no-suggest

- name: Execute tests
run: |
vendor/bin/phpunit
vendor/bin/phpunit tests/Unit/AuditTest.php --group command-line-url-resolver
vendor/bin/phpunit tests/Unit/AuditTest.php --group command-line-url-resolver
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
.idea
/vendor
/build
composer.lock
.vscode
.phpunit.result.cache
.php-cs-fixer.cache
16 changes: 16 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

$finder = PhpCsFixer\Finder::create()
->in(__DIR__ . '/src')
->name('*.php');

$config = new PhpCsFixer\Config();
return $config->setRules([
'@PSR12' => true,
'strict_param' => true,
'array_syntax' => ['syntax' => 'short'],
'binary_operator_spaces' => [
'default' => 'single_space',
],
])
->setFinder($finder);
31 changes: 16 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<a href="https://discord.gg/csD9ysg"><img src="https://img.shields.io/badge/chat-on%20discord-7289DA.svg" alt="Chat"></a>
</p>

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.
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.

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.

Expand All @@ -24,20 +24,21 @@ Thank you for choosing OwenIt\LaravelAuditing!

## Version Information

Version | Illuminate | Status | PHP Version
:----------|:---------------|:------------------------|:------------
13.x | 7.x.x - 11.x.x | Active support :rocket: | > = 7.3 \| 8.0
12.x | 6.x.x - 9.x.x | End of life | > = 7.3 \| 8.0
11.x | 5.8.x - 8.x.x | End of life | > = 7.3
10.x | 5.8.x - 7.x.x | End of life | > = 7.2.5
9.x | 5.8.x - 6.x.x | End of life | > = 7.1.3
8.x | 5.2.x - 5.7.x | End of life | > = 7.0.13
7.x | 5.2.x - 5.6.x | End of life | > = 7.0.13
6.x | 5.2.x - 5.6.x | End of life | > = 7.0.13
5.x | 5.2.x - 5.5.x | End of life | > = 7.0.13
4.x | 5.2.x - 5.5.x | End of life | > = 5.5.9
3.x | 5.2.x - 5.4.x | End of life | > = 5.5.9
2.x | 5.1.x - 5.3.x | End of life | > = 5.5.9
Version | Illuminate | Status | PHP Version
:--------|:---------------|:------------------------|:------------
14.x | 9.x.x - 11.x.x | Active support :rocket: | > = 8.0
13.x | 7.x.x - 11.x.x | Active support :rocket: | > = 7.3 \| 8.0
12.x | 6.x.x - 9.x.x | End of life | > = 7.3 \| 8.0
11.x | 5.8.x - 8.x.x | End of life | > = 7.3
10.x | 5.8.x - 7.x.x | End of life | > = 7.2.5
9.x | 5.8.x - 6.x.x | End of life | > = 7.1.3
8.x | 5.2.x - 5.7.x | End of life | > = 7.0.13
7.x | 5.2.x - 5.6.x | End of life | > = 7.0.13
6.x | 5.2.x - 5.6.x | End of life | > = 7.0.13
5.x | 5.2.x - 5.5.x | End of life | > = 7.0.13
4.x | 5.2.x - 5.5.x | End of life | > = 5.5.9
3.x | 5.2.x - 5.4.x | End of life | > = 5.5.9
2.x | 5.1.x - 5.3.x | End of life | > = 5.5.9

## Contributing
Please see the [contributing](http://laravel-auditing.com/docs/master/contributing) entry for more details.
Expand Down
32 changes: 22 additions & 10 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,19 @@
}
],
"require": {
"php": "^7.3|^8.0",
"illuminate/console": "^7.0|^8.0|^9.0|^10.0|^11.0",
"illuminate/database": "^7.0|^8.0|^9.0|^10.0|^11.0",
"illuminate/filesystem": "^7.0|^8.0|^9.0|^10.0|^11.0",
"ext-json": "*"
"php": "^8.0",
"ext-json": "*",
"illuminate/console": "^9.0|^10.0|^11.0",
"illuminate/database": "^9.0|^10.0|^11.0",
"illuminate/filesystem": "^9.0|^10.0|^11.0"
},
"require-dev": {
"larastan/larastan": "^2.0",
"mockery/mockery": "^1.5.1",
"orchestra/testbench": "^7.22.1|^8.0|^9.0",
"phpstan/extension-installer": "^1.4",
"phpunit/phpunit": "^9.6|^10.5|^11.0",
"mockery/mockery": "^1.0",
"orchestra/testbench": "^5.0|^6.0|^7.0|^8.0|^9.0",
"laravel/legacy-factories": "*"
"squizlabs/php_codesniffer": "^3.10"
},
"autoload": {
"psr-4": {
Expand All @@ -66,14 +68,24 @@
},
"extra": {
"branch-alias": {
"dev-master": "v13-dev"
"dev-master": "v14-dev"
},
"laravel": {
"providers": [
"OwenIt\\Auditing\\AuditingServiceProvider"
]
}
},
"scripts": {
"test": "phpunit",
"format": "php-cs-fixer fix --allow-risky=yes",
"analyse": "phpstan analyse"
},
"minimum-stability": "dev",
"prefer-stable": true
"prefer-stable": true,
"config": {
"allow-plugins": {
"phpstan/extension-installer": true
}
}
}
22 changes: 11 additions & 11 deletions config/audit.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@
|
*/

'user' => [
'user' => [
'morph_prefix' => 'user',
'guards' => [
'guards' => [
'web',
'api'
'api',
],
'resolver' => OwenIt\Auditing\Resolvers\UserResolver::class
'resolver' => OwenIt\Auditing\Resolvers\UserResolver::class,
],

/*
Expand All @@ -44,7 +44,7 @@
'resolvers' => [
'ip_address' => OwenIt\Auditing\Resolvers\IpAddressResolver::class,
'user_agent' => OwenIt\Auditing\Resolvers\UserAgentResolver::class,
'url' => OwenIt\Auditing\Resolvers\UrlResolver::class,
'url' => OwenIt\Auditing\Resolvers\UrlResolver::class,
],

/*
Expand All @@ -60,7 +60,7 @@
'created',
'updated',
'deleted',
'restored'
'restored',
],

/*
Expand Down Expand Up @@ -101,9 +101,9 @@
|
*/

'empty_values' => true,
'empty_values' => true,
'allowed_empty_values' => [
'retrieved'
'retrieved',
],

/*
Expand Down Expand Up @@ -164,7 +164,7 @@

'drivers' => [
'database' => [
'table' => 'audits',
'table' => 'audits',
'connection' => null,
],
],
Expand All @@ -181,8 +181,8 @@
'queue' => [
'enable' => false,
'connection' => 'sync',
'queue' => 'default',
'delay' => 0,
'queue' => 'default',
'delay' => 0,
],

/*
Expand Down
12 changes: 4 additions & 8 deletions database/migrations/audits.stub
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateAuditsTable extends Migration
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
public function up(): void
{
$connection = config('audit.drivers.database.connection', config('database.default'));
$table = config('audit.drivers.database.table', 'audits');
Expand Down Expand Up @@ -39,14 +37,12 @@ class CreateAuditsTable extends Migration

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
public function down(): void
{
$connection = config('audit.drivers.database.connection', config('database.default'));
$table = config('audit.drivers.database.table', 'audits');

Schema::connection($connection)->drop($table);
}
}
};
10 changes: 10 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
parameters:
bootstrapFiles:
- tests/ClassAliases.php
level: 8
paths:
- src
- config
- database/migrations/audits.stub
- stubs
tmpDir: build/phpstan
Loading
Loading