spatie/laravel-event-projector
Deprecated in favor of spatie/laravel-event-sourcing. Entry-level event sourcing toolkit for Laravel: define aggregates, projectors, and reactors; persist domain events, build read models, and react to events for auditing and reporting-friendly apps.
By default we store the Event's FQCN in the database when storing the events. This prevents you from changing the name or the namespace of your event classes.
To get around this you can define event class aliases in the event-projector.php config file:
/*
* Similar to Relation::morphMap() you can define which alias responds to which
* event class. This allows you to change the namespace or classnames
* of your events but still handle older events correctly.
*/
'event_class_map' => [
'money_added' => MoneyAddedEvent::class,
],
With this configuration, instead of saving \App\Events\MoneyAddedEvent in the database, we just store money_added, now you can change the event class name and namespace. Just make sure to also change the mapping!
How can I help you explore Laravel packages today?