NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
Packagist · #1516 most downloaded on Packagist
The easiest way to get started with event sourcing in Laravel
Last release 1 months ago
10 Aug 2026
Release timing varies
gaps range from 2 weeks to 6 months
Nearly every release is documented
notes for 54 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
7 years old
117 releases · first in 2019
fix AggregateRoot return types for static analysis
Use jsonb in migration stubs instead of json
jsonb in migration stubs instead of json (#237)Fix visual glitch in event-sourcing:list command where event handlers wouldn't be shown
One column per quarter.
event-sourcing:list command where event handlers wouldn't be shown- fix $whenResult
$whenResult (#227)Support legacy spatie/laravel-schemaless-attributes:^1.0 as well
spatie/laravel-schemaless-attributes:^1.0 as wellmove migrations to default location
Add EloquentStoredEvent::query()->whereEvent(EventA::class, …)
Add EloquentStoredEvent::query()->whereEvent(EventA::class, …)
Add EventQuery
Add AggregatePartial
parent::__construct from itAdd command bus and aggregate root handlers
Add Projectionist::fake(OriginalReactor::class, FakeReactor::class) (#181)
All event listeners are now registered in the same way: by looking at an event's type hint. This applies to all:
apply methodsMoved Spatie\EventSourcing\Exception\CouldNotPersistAggregate to Spatie\EventSourcing\AggregateRoots\Exceptions\CouldNotPersistAggregate
Moved Spatie\EventSourcing\Exception\InvalidEloquentSnapshotModel to Spatie\EventSourcing\AggregateRoots\Exceptions\InvalidEloquentSnapshotModel
Moved Spatie\EventSourcing\Exception\InvalidEloquentStoredEventModel to Spatie\EventSourcing\AggregateRoots\Exceptions\InvalidEloquentStoredEventModel
Moved Spatie\EventSourcing\Exception\MissingAggregateUuid to Spatie\EventSourcing\AggregateRoots\Exceptions\MissingAggregateUuid
Moved Spatie\EventSourcing\Exception\InvalidStoredEvent to Spatie\EventSourcing\StoredEvents\Exceptions\InvalidStoredEvent
Dependency injection in handlers isn't supported anymore, use constructor injection instead
$storedEvent and $aggregateRootUuid are no longer passed to event handler methods. Use $event->storedEventId() and $event->aggregateRootUuid() instead. (#180)
Rename EloquentStoredEvent::query()->uuid() to EloquentStoredEvent::query()->whereAggregateRoot()
Removed AggregateRoot::$allowConcurrency
Removed $aggregateVersion from StoredEventRepository::persist
Removed $aggregateVersion from StoredEventRepository::persistMany
Event handlers are no longer called with app()->call() (#180)
$handlesEvents on Projectors and Reactors isn't supported anymore
PHP version requirement is now ^8.0
Laravel version requirement is now ^8.0
Since most code is probably already type hinting events, the listener change is likely to not have an impact on your code. It's good to know though that you don't have to worry about certain naming conventions any more:
apply anymore if you don't want to$event$eventHere's an example:
class MyProjector extends Projector
{
public function anEventHandlerWithAnotherName(MyEvent $eventVariableWithAnotherName): void
{
// This handler will automatically handle `MyEvent`
}
}
Note that __invoke in projectors and reactors works the same way, it's automatically registered based on the type hinted event.
Add missing config key in config stub
Also store aggregate root version when one event is persisted
Deprecate AggregateRoot::$allowConcurrency
AggregateRoot::$allowConcurrencypublic function up()
{
Schema::table('stored_events', function (Blueprint $table) {
$table->unique(['aggregate_uuid', 'aggregate_version']);
});
}
Note: if you run this migration, all aggregate roots using $allowConcurrency will not work any more.
- Make base path configurable
Add support for asserting events with a closure
Fix for broken dependency in 4.7.1
- Fix for array serialization
- add support for PHP 8
remove unused replay_chunk_size config value
replay_chunk_size config value- allow protected apply methods
re-use existing instance of ShouldBeStored when possible
ShouldBeStored when possible (#158)fix Paths and Reference URL in event-sourcing.php config file
- added loadUuid
loadUuid (#156)- make normalizers configurable
Support then for aggregate root fakes
then for aggregate root fakes (#154)- Support Laravel 8
- support Carbon dates in events
allow events to be dispatched from an aggregate root
add assertion that specific event is recorded
- config style fix
- add snapshot_model config key
snapshot_model config keyprojectors now are abstract classes instead of interfaces
ShouldQueue marker interfaceShouldBeStored now can retrieve the aggregate root uuid using aggregateRootUuid()ShouldBeStored can now handle metadata using metaData and setMetaDatapersistWithoutApplyingToEventHandlershandleStoredEventspersistAggregateRootsInTransaction to AggregateRootuuid of an aggregate root using the uuid() methodreset method has been removed on projectorsfake method on an aggregate root now accepts a uuid instead of an array of eventsmeta_data property on StoredEvent is now an array or a string instead of SchemalessAttributesdefault to BigIncrements on package table stubs
BigIncrements on package table stubs (#124)replace model where clause with uuid model scope
config file comment corrections
expose aggregate_version of StoredEvent
aggregate_version of StoredEvent (#115)- use app helper (#117) > > > > > > > master
app helper (#117)master
allow aggregate roots to have dependencies in constructor
- wrong tag, nothing changed
only include public properties of the aggregate when snapshotting
- simplify snapshot dates
add static return type docblock for AggregateRoot::retrieve
static return type docblock for AggregateRoot::retrievemake sure created_at is filled when creating a snapshot
created_at is filled when creating a snapshot- add support for Laravel 7
fix for serializing events that use immutable datetime objects
only replace the first instance of the basePath in DiscoversEventHandlers
basePath in DiscoversEventHandlers (#62)- publish snapshots migration
add the ability to snapshot aggregates
- add countAllStartingFrom
countAllStartingFromdo not dispatch job when there is nothing to be performed on queue
- drop PHP 7.3
Nothing published for this version
Nothing published for this version
Nothing published for this version
fix replay from specified event id
provide docblocks to AggregateRoot class
implemented missing HandleDomainEventJob interface
fix an issue with encoding the event_properties when they're already a string
event_properties when they're already a stringThis package supercedes spatie/laravel-event-projector
This package supercedes spatie/laravel-event-projector
To learn how to upgrade from laravel-event-projector v3 to laravel-event-sourcing v1 , read our upgrade guide
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →