- This package improve the way laravel manage his listener to be able to listen on parent class of the event
- This package allow storing the event in the database in order to make them restorable
Add an Extends from Bepark\Eventer\EventServiceProvider
to the event provider class App\Provider\EventServiceProvider
With just this installation the event will be saved in your database.
You can also publish the config file php artisan vendor:publish --provider="Bepark\Eventer\AppServiceProvider"
. You'll be able to set listen_on_eloquent to also store all eloquent event generated by Laravel
You can listen on the parent class of the triggered event by using the EventHelper. Check the StorableEventListener to see how it works.
listenWithChildren()
will start listening on all event and will call the listener when it match.
Call it in the subscribe() method of your listener
EventHelper::listenWithChildren(Dispatcher $event, <ParentClass>, 'ListenerClass@method');