Download the PHP package grummfy/laravel-restorable-events without Composer
On this page you can find all versions of the php package grummfy/laravel-restorable-events. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download grummfy/laravel-restorable-events
More information about grummfy/laravel-restorable-events
Files in grummfy/laravel-restorable-events
Package laravel-restorable-events
Short Description This library is an help to store and restore events for laravel.
License MIT
Informations about the package laravel-restorable-events
Laravel restorable events
This library is an help to store and restore events.
Compatible with laravel 5.5.
Install
Install the dependencies
Publish the configuration
Create the model class, using the trait EventStorableTrait
. See the example directory if you need it.
Edit your Providers\EventServiceProvider.php
:
- Use the trait
EventServiceProviderTrait
- You will also require to have this variable set, with at least theses values:
This will allow the usage of the storage of the event on the fly.
Usage
On any event you want to store, just extends RestorableEvent
or implements the two interface RestorableContract
, JsonSerializableContract
.
The rest is made by the listener.
If you need to hook some change, when an event is restored, just implements the restored
method available on it.
If you require you could also prioritise the events. Just fill the $priorities
value from the trait on the service listener.
What's stored
In the event CreditRefilled
is dispatched, it will be saved,
but for each eloquent model, only the id and the name of the model will be saved.
TODO
- unit test
- QA tools
- travis
- styleci
- scrutinizer
- ...