desmart/laravel-event-sourcing
Larablocks Analysis
desmart/laravel-event-sourcing works with Laravel 5 (latest release 1.0.0, May 25, 2016), which reached end of life: no more fixes, even for security.
Recommendation checks
Not advisedNot advised: no release or commit in over 2 years.
- No release or commit in over 2 years
- Supports only Laravel 5, past end of life
- No release in the last 12 months (last: May 25, 2016)
- 0 downloads a month (needs 10,000)
- 7 GitHub stars (needs 100)
State
Likely abandoned- No release or commit in over 2 years.
- Last stable release: May 25, 2016.
- No releases in the last 12 months.
- First released: May 25, 2016.
- 0 open issues on GitHub.
Data from Packagist and GitHub, checked by Larablocks on Dec 3, 2026.
| Install | |
|---|---|
composer require desmart/laravel-event-sourcing |
|
| Latest Version: | 1.0.0 |
| PHP: | >=5.6.0 |
| Laravel: | 5 |
| License: | MIT |
| Last Updated: | May 25, 2016 |
| Links: | GitHub · Packagist |
Laravel Event Sourcing
Simple Laravel implementation of event sourcing mechanism.
Be advised: this package is work in progress and some breaking changes may appear on the way.
Package realizes concept of event sourcing with Laravel framework. Package consists of two main elements: implementation of database-like event store and projection manager.
Event store is a append-only storage dedicated for storing events. Projection manager allows to register projections and update them with generated stream of events.
Installation
To install the package via Composer, simply run the following command:
composer require desmart/laravel-event-sourcing
In order to use provided event store implementation, register service provider in your config/app.php file:
'providers' => [
// ...
DeSmart\EventSourcing\Laravel\EventStore\ServiceProvider::class,
]
In order to use projection manager, register service provider in your config/app.php file:
'providers' => [
// ...
DeSmart\EventSourcing\Laravel\Projections\ServiceProvider::class,
]
After registering service provider(s), run artisan command to publish configuration files:
php artisan vendor:publish
Configuration
Package adds two configuration files: event-store.php and read-model.php.
event-store.php
Here you can configure:
- which connection will be used to connect with your event store,
- which event's payload serializer will be used.
return [
/*
|-------------------------------------------------------------------------------------
| Database Connection For Event Store
|-------------------------------------------------------------------------------------
|
| Specify which database connection should be used for storing events in events store.
| All database connections can be found in config/database.php configuration file.
|
*/
'connection' => null,
/*
|-------------------------------------------------------------------------------------
| Event Store Payload Serializer
|-------------------------------------------------------------------------------------
|
| Serializer used for serializing/deserializing event and it's payload.
|
| Payload is usually of array type. It is sufficient to store payload in
| JSON format.
|
| Supported serializers:
| - 'JsonSerializer' -> use for event store that does not have automatic json serialization/deserialization, like mysql databases
| - 'ArraySerializer -> use for event store that has automatic json serialization/deserialization, like mongodb databases
|
*/
'serializer' => \DeSmart\EventSourcing\Laravel\EventStore\Serializers\JsonSerializer::class
];
read-model.php
Here you can register all projections that should be notified with stream of events.
return [
/*
|--------------------------------------------------------------------------
| Read Model Projections
|--------------------------------------------------------------------------
|
| Array of projection classes.
|
| These projections will be notified about saved stream of events and they
| can react with read model updates.
|
*/
'projections' => []
];
Event store implementation
This package's event store implementation was successfully used/tested with MySql database, MongoDB database as well as with mix of the two: one database served as an event store, where second was storing projections.
Event store required structure (however different column types allowed) can be found here.
License
Package is released under the MIT License (MIT). Please, check LICENSE for more details.
Example usage
For example use of event store as well as project manager, check example/ directory.
Additionally, package provides artisan command for rebuilding all projections:
php artisan projections:rebuild
Related Packages
Dive into Domain Driven Design using Event Sourcing and CQRS within your Laravel...
Version History
| Version | Released | PHP | Laravel | License |
|---|---|---|---|---|
| 1.0.0 | >=5.6.0 | 5.2.* | MIT |