Download the PHP package yajra/laravel-auditable without Composer
On this page you can find all versions of the php package yajra/laravel-auditable. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download yajra/laravel-auditable
More information about yajra/laravel-auditable
Files in yajra/laravel-auditable
Package laravel-auditable
Short Description A simple Laravel user auditing package for Eloquent Model.
License MIT
Homepage https://github.com/yajra/laravel-auditable
Informations about the package laravel-auditable
Laravel Auditable
Laravel Auditable is a simple Laravel auditing package for your Eloquent Model. This package automatically inserts/updates an audit log on your table on who created and last updated the record.
Laravel Version Compatibility
Laravel | Package |
---|---|
5.x-10.x | 4.x |
11.x | 11.x |
12.x | 12.x |
Install via Composer
Publish config file
If you want to modify the withDefault
option on auditable columns, you may publish the config file.
Usage
Update your model's migration and add created_by
and updated_by
field using the auditable()
blueprint macro.
Then use AuditableTrait
on your model.
Soft Deletes
If you wish to use Laravel's soft deletes, use the auditableWithDeletes()
method on your migration instead:
Afterwards, you need to use AuditableWithDeletesTrait
on your model.
Dropping columns
You can drop auditable columns using dropAuditable()
method, or dropAuditableWithDeletes()
if using soft deletes.
And you're done! The package will now automatically add a basic audit log for your model to track who inserted and last updated your records.
Change log
Please see CHANGELOG for more information what has changed recently.
Testing
Contributing
Please see CONDUCT for details.
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Credits
- Arjay Angeles
- All Contributors
License
The MIT License (MIT). Please see License File for more information.