headsnet/domain-events-bundle
Symfony bundle for domain events: define and dispatch events from your domain, register subscribers, and defer delivery until after Doctrine transactions commit, keeping business logic decoupled from infrastructure.
DB::afterCommit / queued listeners, Symfony's kernel.terminate semantics).Adopt when:
Look elsewhere when:
ShouldQueue + afterCommit, DB::afterCommit) already satisfy the requirement — buying a Symfony bundle to get framework-native behavior is negative value.Immediate verification item: confirm whether events raised inside a transaction are queued until commit or silently discarded. The release note is ambiguous, and the two behaviors have materially different product consequences — one is a latency change, the other is data loss. Do not ship on the assumption.
For executives: A dependency update closed a real integrity hole. Previously, a failed database operation could still trigger customer-facing side effects — emails, partner notifications, downstream records — that could not be undone. The library now withholds domain events until the surrounding transaction is safely committed, so failed operations stay silent. This is one patch release, no migration work, and it de-risks the integrations on our roadmap. Cost is a regression test pass, not a project.
For engineering: v0.4.5 changes dispatch timing — events no longer fire while a transaction is active. That is the correct default, but it is a behavioral change shipped in a patch version, so treat it as breaking in practice. Two things to do before merge: (1) read PR #46 and determine whether in-transaction events are deferred to commit or dropped, and (2) audit every listener for immediate-read-after-write assumptions and for any code that relied on mid-transaction dispatch. Add an explicit regression test asserting that a rolled-back transaction produces zero external side effects. Pin the exact version; this package is pre-1.0 and the maintainer is actively changing semantics.
How can I help you explore Laravel packages today?