Events

    Lumen's events provides a simple observer implementation, allowing you to subscribe and listen for events in your application. Event classes are typically stored in the directory, while their listeners are stored in app/Listeners.

    Differences From Laravel

    Generators

    In Lumen, there are no generator commands to generate events and listeners for you, so you should simply copy the ExampleEvent or classes to define your own events and listeners. These example classes provide the basic structure of every event and listener.

    Registering Events / Listeners

    Firing Events

    You may use the helper function or Event facade to fire events throughout your Lumen application. Again, these functions behave exactly like their full Laravel framework equivalent:

    1. Event::dispatch(new ExampleEvent);