Log all model events and revert specific model event
Laravel Model Event Logger and Revert logs every action on a model (create, delete, update), provides an interface to see the list of all activities as well as revert specific model event.
- Laravel Model Event
You can install the package via composer:
composer require djunehor/laravel-revert-query
The package will automatically register itself, so you can start using it immediately.
In Laravel version 5.4 and older, you have to add the service provider in
config/app.php file manually:
'providers' => [ // ... Djunehor\EventRevert\EventRevertServiceProvider::class, ];
After installing the package, you will have to register it in
bootstrap/app.php file manually:
// Register Service Providers // ... $app->register(Djunehor\EventRevert\EventRevertServiceProvider::class); ];
php artisan vendor:publish --tag=ModelEventLoggerThis will move the migration file, seeder file and config file to your app.
config/model-event-loggerto set the model name and ID of users allowed to access to model event log routes
- the ID can be a number or list of comma-separated numbers e.g
php artisan migrateto create the table.
use ModelEventLoggerto your laravel model
||return all saved model events|
||return all model events of a specific model|
||revert specific model event|
If you know the specific ID of the event you which you revert, you can run:
php artisan model:revert --id=EVENT_ID
- Fork this project
- Clone to your repo
- Make your changes and run tests
- Push and create Pull Request