spatie/laravel-eventsauce
62.6
Adequate · 9 November 2026
510
lines of production code
PHP
primary language
10
measurements over time
What this system is
This system is a Laravel package that integrates event sourcing capabilities into PHP applications. It provides infrastructure for managing aggregate roots, persisting domain messages, and dispatching events both synchronously and asynchronously. The package also includes tools for generating boilerplate code and scaffolding for domain-driven design components.
Features
Add CouldNotMakeAggregateRoot exception for file conflicts
A new exception class, CouldNotMakeAggregateRoot, has been introduced in the Spatie Laravel EventSauce package to handle specific errors during aggregate root creation. This exception provides a static factory method, fileAlreadyExists, which allows the application to throw a descriptive error when attempting to create a file at a path that already exists, improving error clarity for users encountering file system conflicts.
src/Exceptions · high confidence
Added stubs for generating domain event-sourcing scaffolding
The \src/Commands/stubs\ directory now includes template files for generating event-sourcing components. This includes an \AggregateRoot\ stub that implements \AggregateRootBehaviour\ and \IgnoresMissingMethods\, an \AggregateRootRepository\ stub extending \Spatie\\LaravelEventSauce\\AggregateRootRepository\ with configurable table names and consumers, and a migration stub for creating the domain messages table. These stubs allow users to generate the necessary boilerplate code for setting up aggregate roots and their persistence layers.
src/Commands/stubs · high confidence
Behavioural changes
Migration to Spatie organization and Laravel 8/PHP 8 support
The package has moved from the \eventsauce\ namespace to \spatie/laravel-eventsauce\, requiring users to update their composer require command and service provider references. This release adds support for Laravel 8.0 and PHP 8, replacing the previous Travis CI configuration with GitHub Actions for testing. Additionally, the project now uses PHP CS Fixer for code style enforcement instead of Scrutinizer, and the README has been updated to reflect the new installation and usage instructions.
(repo-wide) · high confidence
New MakeAggregateRoot command and refined code generation configuration
Users can now generate aggregate root classes, repositories, and database migrations via the new \make:aggregate-root\ Artisan command. Additionally, the \generate-code\ command has been updated to read configuration from \eventsauce.code\_generation\ instead of the nested \eventsauce.aggregate\roots.\.code\_generation\ path, and it now safely skips any configuration entries where the input YAML file is null.
src/Commands · high confidence
Refactored EventSauce configuration structure and updated default implementations
The EventSauce configuration has been restructured to improve clarity and align with updated library conventions. The previous nested 'aggregate\_roots' section, which included inline definitions for consumers and code generation, has been replaced by a top-level 'code\_generation' array for specifying YAML input and output paths. Additionally, the default message dispatcher has been removed in favor of a new 'database\_connection' setting to specify the storage connection, and the default implementations for the message repository and queued message job have been switched from the core EventSauce classes to the Spatie Laravel EventSauce package classes.
config · high confidence
Refactored event sourcing infrastructure with new repository and dispatcher components
The library's internal architecture has been restructured to improve modularity and configuration flexibility. The previous synchronous and asynchronous dispatcher registrations in the service provider have been removed in favor of a new \AggregateRootRepository\ that delegates to a \ConstructingAggregateRootRepository\ and a \MessageDispatcherChain\ composed of \QueuedMessageDispatcher\ and \SynchronousMessageDispatcher\ instances. A new \QueuedMessageJob\ handles asynchronous event processing, replacing the deleted \EventSauceJob\. Additionally, the \MessageRepository\ now accepts a configurable table name instead of hardcoding 'domain\_messages', allowing users to customize the storage location for events via configuration.
src · high confidence
Test coverage
Added Filesystem mock for testing file writes; Added test helper classes for EventSauce integration testing; Added test suite for EventSauce repository and message persistence; Added unit tests for code generation and aggregate root creation commands.
Dependencies
Upgrade to Laravel 7/8 and PHP 8 support
The package now requires PHP 7.4 or 8.0 and upgrades its Laravel dependencies (illuminate/\*) to support versions 7.0 and 8.0. It also updates the underlying eventsauce library to ^0.8, ramsey/uuid to ^4.0, and refreshes dev dependencies including PHPUnit to ^9.4.0 and orchestra/testbench to ^5.0\|^6.0, while adding spatie/temporary-directory as a new dependency.
(dependencies) · high confidence
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Score
- CAI 61 → 63 (+1.6)
- Rubric changed (rubric-2026.10.5 → rubric-2026.11.2) — scores are not directly comparable.
Lenses
- Code Health 71 → 71 (+0.0)
- Architecture 69 → 69 (+0.0)
- Maturity 56 → 61 (+4.6)
- Readiness 58 → 58 (+0.0)
- Security 89 → 89 (+0.0)
Resolved (1)
- Documentation: no contributor guidance (README.md)
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
spatie/laravel-eventsauce was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 9 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit d15bac7d2cc80efd3de475ca896672a32929860d — the exact code this score is about.
- Scored under rubric-2026.11.2 — the same rubric and the same method as every other entry in this index.
- Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.4+preprod-464a0040a931.