gpslab/domain-event
A lightweight, framework-agnostic PHP domain event library. It provides an event bus, listener and subscriber registration, event-to-listener mapping, and deferred event dispatch to help decouple domain logic.
Adopt if:
DomainEventBus interface so the dependency stays swappable.Look elsewhere if:
Event facade cover that with zero new concepts.Mitigation if adopted: pin the version, vendor or fork it, keep it behind an internal interface, and budget a few days to replace it in-house. The surface area is small enough that the escape hatch is cheap.
To executives: This is a free, MIT-licensed library that lets us structure feature-to-feature communication so today's modules can later become independent services without a rewrite. The license cost is zero; the real costs are engineering discipline and a maintenance risk, which we contain by wrapping it in our own interface so it's replaceable in days. Recommend a short spike, not a broad rollout, before committing roadmap capacity.
To engineering: It provides an event bus, aggregate event recording, and — the part that matters — deferred release of events after the transaction commits, which eliminates the class of bug where a confirmation email goes out and then the write rolls back. Compare honestly against Laravel's native dispatcher: the only non-trivial value is the deferred-release mechanism and the framework-free domain layer, and we could reproduce both in a few hundred lines. Given the package is unmaintained since 2019, my recommendation is to prototype with it to validate the pattern, then either vendor it or reimplement the small piece we actually need.
How can I help you explore Laravel packages today?