Overview of Laravel Event Sourcing package capabilities
mainThe spatie/laravel-event-sourcing package serves as an entry point for implementing event sourcing within Laravel applications. It provides the necessary infrastructure to set up and manage the core components of an event-sourced system:
- Aggregates: The domain objects that handle commands and record events.
- Projectors: Components that listen to events to build read models (projections).
- Reactors: Components that listen to events to trigger side effects (like sending emails or calling external APIs).
Event sourcing is particularly useful if your application requires auditing (understanding why a state changed), needs to make decisions based on historical data, or requires flexible reporting capabilities for data that isn't yet fully defined.