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.
Architecture fit
eventsauce/message-repository-for-illuminate is a deliberately thin persistence adapter: it implements EventSauce's MessageRepository contract — persist, retrieveAll, and retrieveAllAfterVersion — over Laravel's Illuminate\Database\ConnectionInterface and query builder. It sits as a boundary between the domain layer (AggregateRoot and serialized domain events/commands) and the database, and it deliberately avoids Eloquent models, observers, and model events. That is the correct shape for a Laravel team that has already decided to adopt EventSauce for a bounded context: no second ORM, no parallel Doctrine connection, and inherited connection pooling, read/write splitting, and multi-database config. The fit is poor if the team has not adopted EventSauce — this is not a general-purpose event store and cannot substitute for Laravel's native events plus an audit-log package.
Integration feasibility
Composer-installable alongside eventsauce/eventsauce and a serializer (typically ConstructingMessageSerializer). Requirements are modest and entirely the integrator's responsibility: a messages table with aggregate root id, aggregate root version, and serialized payload/headers columns; a repository instance constructed with a connection, table name, and serializer; a service-provider binding. There is no published migration, no config file, and no service provider shipped — the first integration is trivial and the first production integration is the real work. This is a small, bounded engineering cost (order of days), which is precisely why it is suitable for a scoped pilot rather than a platform commitment.
Technical risk
The headline metrics (0 stars, 0 dependents, score 0.22) are largely an artifact of packaging: this repo is a [READ ONLY] Composer subtree split mirrored from the EventSauce monorepo, so stars, issues, and PRs live upstream. The real risks for a TPM to register are therefore: (a) governance ambiguity — no issue tracker and no PR path here; roadmap visibility depends entirely on the parent; (b) release coupling — tags are synced from the parent, so a packaging hiccup upstream silently stalls security patches; (c) adoption opacity — with no dependents signal you cannot infer production hardening from the package page, so quality must be assessed by reading the monorepo tests; (d) no repo-level CI in this split, so quality gates are inherited rather than evident. Mitigations are cheap: pin the version, commit the lockfile, name an owner, and accept that a fork is affordable because the surface area is tiny.
Key questions
illuminate/database and PHP versions does the latest tag permit — is Laravel 11/12 covered or are we pinned to an older major?retrieveAll return a Generator (streaming) or materialize an array? This sets the memory ceiling on long-lived aggregates.Stack fit
Requires PHP 8.x, illuminate/database, and the EventSauce core. Because it uses the query builder rather than database-specific SQL, it works across MySQL, PostgreSQL, and SQLite — which lets CI and local development stay on SQLite while production runs Postgres, with no divergence in repository behavior. It composes cleanly with DB::transaction() and Laravel's connection resolver. The explicit non-fit: it will not participate in Eloquent lifecycle hooks, so anything relying on model events, HasUuids, or soft deletes must be implemented at the repository boundary instead.
Migration path
Adopt as a new bounded context rather than retrofitting existing Eloquent aggregates. Greenfield: install the package, hand-write the migration (id/uuid, aggregate root id, version, payload, headers, timestamps), add the unique constraint plus an index on aggregate root id, bind the repository to the MessageRepository interface in a service provider, and wire the serializer. Brownfield: place it behind an internal interface so a future swap to eventsauce/doctrine-message-repository or a bespoke store is a container-binding change, not a rewrite. This keeps "Laravel DB now, managed event store later" a reversible decision.
Compatibility Pin the version and commit the lockfile. Because the package is a read-only mirror, verifying behavior means reading the parent monorepo's tests, not this repo. Treat the serializer's payload format as a stability boundary: a serializer change is a data migration, not a dependency bump, and should be gated by an upgrade runbook.
Sequencing
Maintenance
Low code surface, non-trivial maintenance posture. Patches cannot be contributed to this repository; any bug requires forking the parent monorepo or applying a Composer patch (cweagans/composer-patches), which is a recurring tax paid at every dependency update. Budget a named owner who tracks the parent repository's releases directly, because this repo will not surface changelogs, security advisories, or deprecations to you.
Support Community-only, no SLA. The effective support channel is the EventSauce monorepo's issue tracker. The risk-register entry is "single-maintainer upstream dependency," mitigated by the small surface area — a fork or a ~hundred-line in-house adapter is inexpensive if upstream stalls — and by the fact that no SaaS contract, vendor procurement, or second datastore is involved.
Scaling The dominant concern is not write throughput but stream growth: every load replays the full event stream unless snapshotting is layered on separately. The table grows monotonically and will need partitioning or archival keyed by aggregate root id. Write concurrency is per-aggregate and enforced by version uniqueness, so hot aggregates surface as duplicate-key errors under contention — expected and correct, but only if the application maps them to retries. High-throughput, sharded, or streaming-read workloads are explicitly out of scope.
Failure modes
eventsauce/backoff pairs well).Ramp-up Small and fast on the mechanical side: a competent Laravel engineer is productive in under a day, because the package is one class plus a serializer contract. The real ramp-up cost is conceptual — the team must internalize EventSauce's versioning contract, message serialization, and the fact that this adapter never manages transactions for you. Sponsor a short internal design note covering the schema, the retry-on-conflict policy, and the snapshot/archival decision, since none of that is provided by the package and all of it becomes your team's permanent operational obligation.
How can I help you explore Laravel packages today?