spatie / laravel-event-sourcing
The easiest way to get started with event sourcing in Laravel
Fund package maintenance!
spatie.be/open-source/support-us
Installs: 1 936 809
Dependents: 23
Suggesters: 1
Security: 0
Stars: 774
Watchers: 14
Forks: 165
Open Issues: 1
Requires
- php: ^8.0
- ext-json: *
- illuminate/console: ^9.0|^10.0|^11.0
- illuminate/database: ^9.0|^10.0|^11.0
- illuminate/events: ^9.0|^10.0|^11.0
- illuminate/support: ^9.0|^10.0|^11.0
- phpdocumentor/reflection-docblock: ^5.2
- spatie/better-types: ^0.2.0
- spatie/laravel-package-tools: ^1.9
- spatie/laravel-schemaless-attributes: ^2.0
- symfony/finder: ^6.0|^7.0
- symfony/polyfill-php82: *
- symfony/property-access: ^6.0|^7.0
- symfony/property-info: ^6.0|^7.0
- symfony/serializer: ^6.0|^7.0
Requires (Dev)
- laravel/horizon: ^5.7
- mockery/mockery: ^1.4
- orchestra/testbench: ^7.0|^8.0|^9.0
- pestphp/pest: ^1.22|^2.34
- phpunit/phpunit: ^9.5.10|^10.5
- spatie/fork: ^1.0
- spatie/pest-plugin-snapshots: ^1.1|^2.1
- spatie/phpunit-snapshot-assertions: ^4.0|^5.1
- dev-main
- 7.9.1
- 7.9.0
- 7.8.0
- 7.7.0
- 7.6.2
- 7.6.1
- 7.6.0
- 7.5.0
- 7.4.2
- 7.4.1
- 7.4.0
- 7.3.10
- 7.3.9
- 7.3.8
- 7.3.7
- 7.3.6
- 7.3.5
- 7.3.4
- 7.3.3
- 7.3.2
- 7.3.1
- 7.3.0
- 7.2.4
- 7.2.3
- 7.2.2
- 7.2.1
- 7.2.0
- 7.0.1
- 7.0.0
- v6.x-dev
- 6.0.6
- 6.0.5
- 6.0.4
- 6.0.3
- 6.0.2
- 6.0.1
- 6.0.0
- v5.x-dev
- 5.0.8
- 5.0.7
- 5.0.6
- 5.0.5
- 5.0.4
- 5.0.3
- 5.0.2
- 5.0.1
- 5.0.0
- v4.x-dev
- 4.10.2
- 4.10.1
- 4.10.0
- 4.9.0
- 4.8.0
- 4.7.2
- 4.7.1
- 4.7.0
- 4.6.1
- 4.6.0
- 4.5.3
- 4.5.2
- 4.5.1
- 4.5.0
- 4.4.0
- 4.3.1
- 4.3.0
- 4.2.0
- 4.1.0
- 4.0.2
- 4.0.1
- 4.0.0
- v3.x-dev
- 3.2.3
- 3.2.2
- 3.2.1
- 3.2.0
- 3.1.8
- 3.1.7
- 3.1.6
- 3.1.5
- 3.1.4
- 3.1.3
- 3.1.2
- 3.1.0
- 3.0.4
- 3.0.2
- 3.0.1
- 3.0.0
- v2.x-dev
- 2.1.0
- 2.0.1
- 2.0.0
- v1.x-dev
- 1.1.2
- 1.1.1
- 1.1.0
- 1.0.4
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0.0
- 0.0.1
- dev-record-concurrently
- dev-v1-fixed
This package is auto-updated.
Last update: 2024-11-14 12:39:53 UTC
README
This package aims to be the entry point to get started with event sourcing in Laravel. It can help you with setting up aggregates, projectors, and reactors.
If you've never worked with event sourcing, or are uncertain about what aggregates, projectors and reactors are head over to the getting familiar with event sourcing section in our docs.
Event sourcing might be a good choice for your project if:
- your app needs to make decisions based on the past
- your app has auditing requirements: the reason why your app is in a certain state is equally as important as the state itself
- you foresee that there will be a reporting need in the future, but you don't know yet which data you need to collect for those reports
If you want to skip to reading code immediately, here are some example apps. In each of them, you can create accounts and deposit or withdraw money.
- Larabank built traditionally without event sourcing
- Larabank built with projectors
- Larabank built with aggregates and projectors
Event sourcing in Laravel course
If you want to learn more about event sourcing, check out our course on event sourcing in Laravel
Support us
We invest a lot of resources into creating best in class open source packages. You can support us by buying one of our paid products.
We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on our contact page. We publish all received postcards on our virtual postcard wall.
Documentation
You can find installation instructions and detailed instructions on how to use this package at the dedicated documentation site.
Upgrading from laravel-event-projector
This package supercedes laravel-event-projector. It has the same API. Upgrading from laravel-event-projector to laravel-event-sourcing is easy. Take a look at our upgrade guide.
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you've found a bug regarding security please mail security@spatie.be instead of using the issue tracker.
Postcardware
You're free to use this package, but if it makes it to your production environment we highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using.
Our address is: Spatie, Kruikstraat 22, 2018 Antwerp, Belgium.
We publish all received postcards on our company website.
Credits
The aggregate root functionality is heavily inspired by Frank De Jonge's excellent EventSauce package. A big thank you to Dries Vints for giving lots of valuable feedback while we were developing the package.
Footnotes
1 Quote taken from Event Sourcing made Simple
License
The MIT License (MIT). Please see License File for more information.