Skip to content

Commit 27ce73a

Browse files
committed
Merge remote-tracking branch 'origin/master' into v14-catchup
2 parents caae912 + 23ff144 commit 27ce73a

30 files changed

+905
-191
lines changed

.github/ISSUE_TEMPLATE.md

-32
This file was deleted.

.github/ISSUE_TEMPLATE/Bug_report.yml

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Bug Report
2+
description: "Report something that's broken."
3+
body:
4+
- type: markdown
5+
attributes:
6+
value: "Please read [our full contribution guide](https://github.com/owen-it/laravel-auditing/blob/master/CONTRIBUTING.md) before submitting bug reports. If you notice improper DocBlock, PHPStan, or IDE warnings while using Laravel Auditing, do not create a GitHub issue. Instead, please submit a pull request to fix the problem."
7+
- type: input
8+
attributes:
9+
label: PHP Version
10+
description: Provide the PHP version that you are using. [Please ensure it is still supported.](https://github.com/owen-it/laravel-auditing?tab=readme-ov-file#version-information)
11+
placeholder: "8.3"
12+
validations:
13+
required: true
14+
- type: input
15+
attributes:
16+
label: Laravel Version
17+
description: Provide the Laravel version that you are using. [Please ensure it is still supported.](https://github.com/owen-it/laravel-auditing?tab=readme-ov-file#version-information)
18+
placeholder: "11.x"
19+
validations:
20+
required: true
21+
- type: input
22+
attributes:
23+
label: Package Version
24+
description: Provide the Laravel Auditing package version that you are using. [Please ensure it is still supported.](https://github.com/owen-it/laravel-auditing?tab=readme-ov-file#version-information)
25+
placeholder: "13.6.6"
26+
validations:
27+
required: true
28+
- type: textarea
29+
attributes:
30+
label: Description
31+
description: Provide a detailed description of the issue you are facing. Describe the behaviour you're experiencing and what behaviour you're expecting. Please, do not just copy and paste a random error message and expect help.
32+
validations:
33+
required: true
34+
- type: textarea
35+
attributes:
36+
label: Steps To Reproduce
37+
description: Provide detailed steps to reproduce your issue. Make sure to include code (affected models, configuration, ...). Pastebins, screenshots and/or other resources that may help us understand what's going on, will also be appreciated. If necessary, please provide a GitHub repository to demonstrate your issue using.
38+
validations:
39+
required: true
40+
- type: textarea
41+
attributes:
42+
label: Possible Solutions
43+
description: If you have any ideas on how to solve the issue, add them here, otherwise you can omit this part.

.github/ISSUE_TEMPLATE/config.yml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: Feature request
4+
url: https://github.com/owen-it/laravel-auditing/discussions/new?category=ideas
5+
about: 'For ideas or feature requests, start a new discussion'
6+
- name: Support Questions & Other
7+
url: https://github.com/owen-it/laravel-auditing/discussions/new?category=q-a
8+
about: 'This space is only for reporting bugs. If you have a question or need help use discussions, click:'
9+
- name: Documentation issue
10+
url: https://github.com/owen-it/laravel-auditing.com/issues/new
11+
about: For documentation issues, open a pull request at the owen-it/laravel-auditing.com repository

.github/workflows/run-tests.yml

+14-3
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,28 @@ jobs:
1111
strategy:
1212
fail-fast: false
1313
matrix:
14-
php: [ 8.0, 8.1, 8.2, 8.3 ]
15-
laravel: [ 10.*, 9.* ]
14+
php: [ 8.0, 8.1, 8.2, 8.3, 8.4 ]
15+
laravel: [ 11.*, 10.*, 9.* ]
1616
include:
17+
- laravel: 11.*
18+
testbench: 9.*
1719
- laravel: 10.*
1820
testbench: 8.*
1921
- laravel: 9.*
2022
testbench: 7.*
2123
exclude:
24+
- laravel: 11.*
25+
php: 8.1
26+
- laravel: 11.*
27+
php: 8.0
28+
- laravel: 11.*
29+
php: 7.4
2230
- laravel: 10.*
2331
php: 8.0
24-
32+
- laravel: 9.*
33+
php: 7.4
34+
- laravel: 9.*
35+
php: 8.4
2536

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

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Contributions are always welcome, but to keep things organized, keep in mind the following rules.
33

44
# Bug Reports
5-
When reporting a bug in the Laravel Auditing package, make sure you follow the [rules](http://laravel-auditing.com/docs/master/problems).
5+
When reporting a bug in the Laravel Auditing package, make sure you follow the [rules](https://laravel-auditing.com/guide/community/problems.html).
66

77
Failure to do so, will result in a closed ticket.
88

README.md

+16-16
Original file line numberDiff line numberDiff line change
@@ -12,33 +12,33 @@
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

1919
## Official Documentation
2020

21-
For more information on how to use the package, please refer to our official documentation available on [laravel-auditing.com](https://laravel-auditing.com) or in the [repository](https://github.com/owen-it/laravel-auditing-doc/blob/main/documentation.md) documentation file. Our documentation provides detailed instructions on how to install and use the package, as well as examples and best practices for auditing in Laravel applications.
21+
For more information on how to use the package, please refer to our official documentation available on [laravel-auditing.com](https://laravel-auditing.com) or in the [repository](https://github.com/owen-it/laravel-auditing.com/blob/main/docs/guide/documentation.md) documentation file. Our documentation provides detailed instructions on how to install and use the package, as well as examples and best practices for auditing in Laravel applications.
2222

2323
Thank you for choosing OwenIt\LaravelAuditing!
2424

2525
## Version Information
2626

27-
Version | Illuminate | Status | PHP Version
27+
Version | Illuminate | Status | PHP Version
2828
:--------|:---------------|:------------------------|:------------
29-
14.x | 9.x.x - 10.x.x | Active support :rocket: | > = 8.0
30-
13.x | 7.x.x - 10.x.x | Active support :rocket: | > = 7.3 \ | 8.0
31-
12.x | 6.x.x - 9.x.x | End of life | > = 7.3 \ | 8.0
32-
11.x | 5.8.x - 8.x.x | End of life | > = 7.3
33-
10.x | 5.8.x - 7.x.x | End of life | > = 7.2.5
34-
9.x | 5.8.x - 6.x.x | End of life | > = 7.1.3
35-
8.x | 5.2.x - 5.7.x | End of life | > = 7.0.13
36-
7.x | 5.2.x - 5.6.x | End of life | > = 7.0.13
37-
6.x | 5.2.x - 5.6.x | End of life | > = 7.0.13
38-
5.x | 5.2.x - 5.5.x | End of life | > = 7.0.13
39-
4.x | 5.2.x - 5.5.x | End of life | > = 5.5.9
40-
3.x | 5.2.x - 5.4.x | End of life | > = 5.5.9
41-
2.x | 5.1.x - 5.3.x | End of life | > = 5.5.9
29+
14.x | 9.x.x - 11.x.x | Active support :rocket: | > = 8.0
30+
13.x | 7.x.x - 11.x.x | Active support :rocket: | > = 7.3 \| 8.0
31+
12.x | 6.x.x - 9.x.x | End of life | > = 7.3 \| 8.0
32+
11.x | 5.8.x - 8.x.x | End of life | > = 7.3
33+
10.x | 5.8.x - 7.x.x | End of life | > = 7.2.5
34+
9.x | 5.8.x - 6.x.x | End of life | > = 7.1.3
35+
8.x | 5.2.x - 5.7.x | End of life | > = 7.0.13
36+
7.x | 5.2.x - 5.6.x | End of life | > = 7.0.13
37+
6.x | 5.2.x - 5.6.x | End of life | > = 7.0.13
38+
5.x | 5.2.x - 5.5.x | End of life | > = 7.0.13
39+
4.x | 5.2.x - 5.5.x | End of life | > = 5.5.9
40+
3.x | 5.2.x - 5.4.x | End of life | > = 5.5.9
41+
2.x | 5.1.x - 5.3.x | End of life | > = 5.5.9
4242

4343
## Contributing
4444
Please see the [contributing](http://laravel-auditing.com/docs/master/contributing) entry for more details.

composer.json

+7-8
Original file line numberDiff line numberDiff line change
@@ -41,18 +41,17 @@
4141
"require": {
4242
"php": "^8.0",
4343
"ext-json": "*",
44-
"illuminate/console": "^9.0|^10.0",
45-
"illuminate/database": "^9.0|^10.0",
46-
"illuminate/filesystem": "^9.0|^10.0",
47-
"nesbot/carbon": "^2.72"
44+
"illuminate/console": "^9.0|^10.0|^11.0",
45+
"illuminate/database": "^9.0|^10.0|^11.0",
46+
"illuminate/filesystem": "^9.0|^10.0|^11.0"
4847
},
4948
"require-dev": {
50-
"friendsofphp/php-cs-fixer": "^3.64",
51-
"larastan/larastan": "^2",
49+
"laravel/legacy-factories": "*",
50+
"larastan/larastan": "^2.0",
5251
"mockery/mockery": "^1.5.1",
53-
"orchestra/testbench": "^7.22.1|^8.0",
52+
"orchestra/testbench": "^7.22.1|^8.0|^9.0",
5453
"phpstan/extension-installer": "^1.4",
55-
"phpunit/phpunit": "^9.6.5",
54+
"phpunit/phpunit": "^9.6|^10.5|^11.0",
5655
"squizlabs/php_codesniffer": "^3.10"
5756
},
5857
"autoload": {

config/audit.php

+14
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,19 @@
106106
'retrieved',
107107
],
108108

109+
/*
110+
|--------------------------------------------------------------------------
111+
| Allowed Array Values
112+
|--------------------------------------------------------------------------
113+
|
114+
| Should the array values be audited?
115+
|
116+
| By default, array values are not allowed. This is to prevent performance
117+
| issues when storing large amounts of data. You can override this by
118+
| setting allow_array_values to true.
119+
*/
120+
'allowed_array_values' => false,
121+
109122
/*
110123
|--------------------------------------------------------------------------
111124
| Audit Timestamps
@@ -166,6 +179,7 @@
166179
*/
167180

168181
'queue' => [
182+
'enable' => false,
169183
'connection' => 'sync',
170184
'queue' => 'default',
171185
'delay' => 0,

src/Audit.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public function resolveData(): array
7777

7878
// Metadata
7979
$this->data = [
80-
'audit_id' => $this->id,
80+
'audit_id' => $this->getKey(),
8181
'audit_event' => $this->event,
8282
'audit_tags' => $this->tags,
8383
'audit_created_at' => $this->serializeDate($this->{$this->getCreatedAtColumn()}),
@@ -102,12 +102,12 @@ public function resolveData(): array
102102
$this->metadata = array_keys($this->data);
103103

104104
// Modified Auditable attributes
105-
foreach ($this->new_values as $key => $value) {
106-
$this->data['new_'.$key] = $value;
105+
foreach ($this->new_values ?? [] as $key => $value) {
106+
$this->data['new_' . $key] = $value;
107107
}
108108

109-
foreach ($this->old_values as $key => $value) {
110-
$this->data['old_'.$key] = $value;
109+
foreach ($this->old_values ?? [] as $key => $value) {
110+
$this->data['old_' . $key] = $value;
111111
}
112112

113113
$this->modified = array_diff_key(array_keys($this->data), $this->metadata);

0 commit comments

Comments
 (0)