zaengle / audits
A package to manage model audits
Installs: 5 485
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: ^8.1|^8.2
- ext-json: *
- illuminate/console: 8.*|9.*|10.*|11.*
- illuminate/support: 8.*|9.*|10.*|11.*
Requires (Dev)
- mockery/mockery: >=0.9.9
- orchestra/testbench: ~8.0
- phpunit/phpunit: >=4.1
README
Audits
This packages records changes to a Laravel model and stores them in a json column on the model.
Usage
Use the MakesAudits
trait on your model.
Next add a nullable json column to your model. By default the package will look for a column called audits
. To override the auditable column, change the $auditableColumn
property on your model.
protected $auditableColumn = 'audits';
Finally add a json
cast for the auditable column.
protected $casts = [
'audits' => 'json',
];
Attributions
If you are looking for a more robust solution, this package is worth checking out: Laravel Auditor