patchlevel/laravel-event-sourcing
Laravel event sourcing with aggregates, projectors, reactors, snapshots, and a database-backed event store. Includes artisan tooling, testing helpers, and a clean API for modeling domain events in Laravel applications.
Architecture fit. patchlevel/laravel-event-sourcing is an opinionated event-sourcing/CQRS layer for Laravel: aggregates, stored domain events, projectors and reactors, wired through a service provider. It fits applications where an auditable event log and derived read models are a domain requirement (ledgers, order lifecycles, approval workflows, anything needing temporal queries or replay). It does not fit CRUD-first applications, and adopting it is an architectural commitment, not a library swap — the 1.5.0 changes do not alter that calculus.
What 1.5.0 actually delivers. Six merged PRs, two contributors, no issues closed. Three substantive enhancements:
Technical risk. Low-to-moderate, and concentrated in one place: #57 "adapt to the hashed metadata cache keys" implies the cache key format changed within the release. On upgrade, previously cached metadata entries become unreachable (benign) or, if a key collides with an earlier scheme, could surface stale metadata (not benign). Treat cache-flush-on-deploy as mandatory. The cache also introduces a new failure domain between the event store and hydration — a correctness-sensitive path. #39 is more consequential architecturally: introducing Illuminate-backed stores means a persistence/configuration decision that should be made deliberately, not inherited by default.
Key questions for the maintainers / our spike.
Stack fit. Requires a Laravel application on a currently supported version (confirm the constraint in composer.json against our pinned framework minor). Dependencies are light — larastan bumped to 3.10.0 is dev-only. The Illuminate store work means we can now run against the database and cache backends we already operate instead of bespoke drivers, which is the single biggest integration win in this release.
Migration path. Nothing in the notes is flagged as breaking, so the path is a routine minor bump: update the constraint to ^1.5, composer update patchlevel/laravel-event-sourcing, run the existing test suite, then flush the metadata cache as part of the deploy. The larger migration decision is orthogonal to the version bump: if we choose to move onto the Illuminate store implementations, that is a data-migration project, not a dependency upgrade — plan it separately with a dual-write or replay-based cutover and a verified read-model rebuild.
Compatibility. Verify three things before merge: (a) our cache driver supports the key operations used (tagging if relied upon — Redis/Memcached differ from file/array); (b) any custom store or hydrator implementations still satisfy the interfaces; (c) doc links in our ADRs and runbooks are repointed to patchlevel.dev.
Sequencing.
Maintenance. Two contributors on this release, with one (DanielBadura) authoring five of six PRs — a clear bus-factor signal. Renovate automation is present, which is a positive health indicator, but dependency updates arriving via bot PRs need a human reviewer with context. Budget for us being the de facto maintainers of our integration layer. The docs move to patchlevel.dev means our internal runbooks must be updated or they will silently rot.
Support. Community-supported OSS with no commercial SLA. Escalation path is GitHub issues/PRs; if event sourcing is load-bearing for revenue flows, we need an internal owner who can read the package source and patch it. Do not adopt on the assumption that upstream will respond on our timeline.
Scaling. The metadata cache is the scaling feature here — it targets repeated metadata reads during hydration and replay, which is where event-sourced systems typically get expensive. Confirm the cache is shared across app instances (Redis/Memcached, not array/file) or each node warms independently and the benefit largely evaporates. The Illuminate stores should improve scaling ergonomics by letting us use managed DB infrastructure and standard connection pooling rather than custom drivers.
Failure modes.
Ramp-up. The 1.5.0 surface itself is small and learnable in a day. The real ramp is event sourcing as a paradigm — aggregates, projector idempotency, replay discipline, versioning of events. Assume two to three weeks before a mid-level engineer is productive and safe to modify projectors unsupervised. Pair that with a written internal standard covering cache configuration, replay procedure, and store selection, so the 1.5.0 decisions are recorded rather than rediscovered at the next minor release.
How can I help you explore Laravel packages today?