Downloads
Stars
Version
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.
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=ModelEventLogger
This will move the migration file, seeder file and config file to your app.config/model-event-logger
to set the model name and ID of users allowed to access to model event log routes1,2,3,4,5
php artisan migrate
to create the table.use Djunehor\EventRevert\ModelEventLogger;`
use ModelEventLogger
to your laravel modelEndpoint | Description |
---|---|
/model-events |
return all saved model events |
/model-events/{log} |
return all model events of a specific model |
/model-event-revert/{id} |
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
composer test