Wallogit.com
2017 © Pedro Peláez
Eloquent helper class to handle auditing
Eloquent helper to audit database transactions by simply adding its trait to your Eloquent model., (*1)
This package can be installed with Composer running the following command:, (*2)
php require MauricioBernal\EloquentAuditing
After installing the EloquentAuditing, register the MauricioBernal\ElquentAuditing\EloquentAuditingServiceProvider in your config/app.php configuration file like:, (*3)
'providers' => [
// ...
MauricioBernal\EloquentAuditing\EloquentAuditingServiceProvider::class
],
Publish the attached migration to generate the audit table in which all transaction will be recorded., (*4)
php artisan vendor:publish --provider="MauricioBernal\EloquentAuditing\EloquentAuditingServiceProvider"
Run composer dump-autoload and run the migrations., (*5)
php artisan migrate
To start registering all transactions you need to add the trait MauricioBernal/EloquentAuditing/Auditing in your eloquent model., (*6)
namespace App;
use Illuminate\Foundation\Auth\User as Authenticatable;
use MauricioBernal\EloquentAuditing\Auditing;
class User extends Authenticatable
{
use Auditing;
// ...
protected $recordEvents = ['created', 'updated', 'deleted'];
Contributions are welcomed; to keep things organized, all bugs and requests should be opened on github issues tab for the main project in Issues., (*7)
All pull requests should be made to the 'dev' branch, so they can be tested before being merged into master., (*8)
The laravel-audit package is open source software licensed under the license MIT, (*9)