be-park/eventer

Improve laravel listener and register event in database making them restorable
16,340
Install
composer require be-park/eventer
Latest Version:v4.1
License:MIT
Last Updated:Oct 1, 2020
Links: GitHub  ·  Packagist
Maintainer: jeremy379

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

Related Packages

doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

631,580,251 9,707
laravel/framework

The Laravel Framework.

580,311,802 34,925
laravel/tinker

Powerful REPL for the Laravel framework.

489,754,436 7,444
laravel/serializable-closure

Laravel Serializable Closure provides an easy and secure way to serialize closur...

404,034,618 608
nunomaduro/collision

Cli error handling for console/command-line PHP applications.

384,821,166 4,658