Skip to content
/ eventer Public

Make event stored in database and restorable

Notifications You must be signed in to change notification settings

BePark/eventer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Laravel event and listener upgrade

  • 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

Installation

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

Listen on parent class

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');