eventsauce/message-repository-for-illuminate
Laravel integration for EventSauce message repositories, letting you persist and retrieve domain events through Illuminate's database and Eloquent layers. Configure a message repository in your app and use it to store event streams, with support for Laravel's connections and transaction handling.
MessageRepository contract (append, load full stream, load after version) over Laravel's Illuminate\Database connection. The decision it unlocks is not "should we build an event store" but "should we spend sprint time on domain modelling instead of writing and maintaining a ~hundred-line repository adapter." It is cheap enough that the honest comparison is against an internal spike, and the answer is usually to adopt, pin, and move on.Adopt when:
illuminate/database — not a parallel Doctrine connection, not a second datastore, and you value inheriting Laravel's connection pooling, read/write splitting, and multi-database config for free.Look elsewhere — or budget to write your own adapter — when:
EventSaucePHP/EventSauce monorepo. If the parent is not releasing and this split is not being re-synced, treat the package as unmaintained and plan accordingly.HasUuids, soft deletes, query-builder convenience. Everything model-like must be reimplemented at the repository boundary.For executives: this is a small, free, open-source integration component that lets us evaluate event sourcing — and the audit trail, replay, and point-in-time reporting it enables — without buying a platform or standing up a second database. It runs on the database we already operate. The downside is deliberately bounded: days of integration effort, one new table, and no vendor lock-in, because our domain code depends on an abstraction rather than on this package. The one governance caveat is that it is a read-only published artifact mirrored from an upstream project, so we should pin the version, assign an owner to watch upstream releases, and treat a fork as an inexpensive fallback. Recommendation: fund a time-boxed pilot on one non-critical bounded context, measure it against the audit-trail use case, and decide on wider adoption before expanding scope.
For engineering: this supplies the MessageRepository implementation for EventSauce backed by Illuminate's database connection — essentially one class plus a serializer contract, with no service provider, no config file, and no published migration. You own the schema: an aggregate root id, an aggregate root version, and a serialized payload/headers column, plus a unique index on (aggregate root id, version) — without which optimistic concurrency is advisory only and silent stream corruption is possible. The adapter never manages transactions and does not participate in Eloquent lifecycle hooks, so wrap writes in DB::transaction(), map duplicate-key violations to a retry or a domain-level conflict (eventsauce/backoff pairs well here), and be aware that loading replays the full stream unless you layer snapshotting separately. Because this is a read-only sub-split, verifying behavior means reading the parent monorepo's tests, and a serializer change is a data migration, not a dependency bump. Sequence it: spike append/reload/conflict behavior on SQLite in CI, harden the index and concurrency mapping, pilot one aggregate behind a feature flag, and only then expand.
How can I help you explore Laravel packages today?