Events allow you to subscribe and listen to various actions that occur in your app, decoupling the triggering code from the reaction. An Event class carries data, and one or more Listener classes handle it, optionally implementing ShouldQueue to run asynchronously. Events are dispatched with Event::dispatch() or the event() helper.
← Laravel theorytheory 0/50 · 0%
Architecture · easy
19. Events & Listeners
Decoupling actions with events.
Check your understanding
1. What interface makes a listener run on a queue?
2. How is an event typically dispatched?