Event Sourcing with Laravel
summary
Shows how to implement Event Sourcing and CQRS in Laravel using Spatie’s laravel-event-sourcing package by building an e-commerce demo: commands to aggregate roots produce events stored in a stored_events table, projectors/Reactors update denormalized product and order views, and full replay is supported after dropping views. Setup uses Artisan, migrations and snapshots; the repository (779 stars, 116 contributors) is used in the demo, which registers products, processes purchases, and triggers notifications.
AI-written summary · about
chapters (15)
- 0:00Event Sourcing intro
- 1:12Who knows Event Sourcing?
- 3:56Classic system problems
- 5:04How Event Sourcing works
- 11:31Key Event Sourcing components
- 14:04Laravel library intro
- 14:45Command and aggregate
- 18:03Model and projection
- 19:50Reactors and automation
- 22:39Live demo: purchase
- 27:16Q&A
- 31:56Runtime event handling
- 34:08Model changes over time
- 36:55Payload limits
- 39:26Conclusion
related talks
32mEvent Sourcing in Laravel
32mEvent Sourcing in Laravel with EventSauce
25mCQRS and Event Sourcing: May the Event Be with You
43mAdding Event Sourcing to an existing PHP project (for the right reasons)
41mAdding Event Sourcing to an existing PHP project (for the right reasons)
58mPHP + ES + CQRS + DDD = ? An integrated strategy
33mPut Verbs in your database
36mBuilding a GraphQL API with Laravel
