Leveraging Events
summary
Explains how concrete pub/sub is implemented in Laravel with event classes that hold data and plain PHP listener classes with handle methods, registered in an Laravel event service provider array or subscriber and matched by name or wildcard, noting 50–60 native events the framework emits. Demo at leveragingevents.com creates fake users, runs a vote quiz and a GDPR gate where a listener returns false to stop propagation (works only synchronously). Queued listeners implement ShouldQueue, failures raise retry/failed events, and outbound tasks post to Thermostat IO while broadcasting over sockets to a Vue front end updating charts in real time.
AI-written summary · about
chapters (11)
- 0:00Introduction
- 2:06What are Events
- 5:00Defining Events
- 10:00Leveraging Events
- 14:45Handling GDPR
- 17:12Handling errors
- 18:25Dynamic frontend
- 20:13Cue listeners
- 22:10Summary
- 23:05Laravel
- 23:44Questions
related talks
47mDon't get hooked, listen to events! PSR-14 within TYPO3 v10
44mAbusing Laravel for Fun and Profit
38mShit Happens – Achieve Extensibility
43mDesigning Event-driven architectures with AsyncAPI
56mEvents on the outside, on the inside and at the core
44mThe Dark Side of Events
38mLaravel Design Patterns
39mResisting complexity
