Download the PHP package djunehor/laravel-revert-query without Composer
On this page you can find all versions of the php package djunehor/laravel-revert-query. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package laravel-revert-query
Laravel Model Event Log & Revert
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
- Installation
- Laravel 5.5 and above
- Laravel 5.4 and older
- Lumen
- Usage
- All parts of speech
- Get part of speech
- Contributing
- Installation
Installation
Step 1
You can install the package via composer:
Laravel 5.5 and above
The package will automatically register itself, so you can start using it immediately.
Laravel 5.4 and older
In Laravel version 5.4 and older, you have to add the service provider in config/app.php
file manually:
Lumen
After installing the package, you will have to register it in bootstrap/app.php
file manually:
Step 2 - Publishing files
- Run:
php artisan vendor:publish --tag=ModelEventLogger
This will move the migration file, seeder file and config file to your app. - Open
config/model-event-logger
to 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
1,2,3,4,5
Step 3 - SetUp database
- Run
php artisan migrate
to create the table.
Usage
- Add
use ModelEventLogger
to your laravel model
Access Saved model event logs
Endpoint | 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 |
Reverting via Console
If you know the specific ID of the event you which you revert, you can run:
php artisan model:revert --id=EVENT_ID
Contributing
- Fork this project
- Clone to your repo
- Make your changes and run tests
composer test
- Push and create Pull Request