Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Domain Event Bundle

Domain Event Bundle Laravel Package

gpslab/domain-event-bundle

Symfony bundle that integrates gpslab/domain-event with the framework, making it easy to publish and handle domain events through Symfony services and configuration. Lightweight setup for decoupled domain events in Symfony applications.

View on GitHub
Deep Wiki
Context7

Bundle to create the domain layer of your DDD application

Frequently asked questions about Domain Event Bundle
Is gpslab/domain-event-bundle a Laravel package?
No. It is a Symfony bundle that integrates the gpslab/domain-event library into Symfony's kernel, DependencyInjection container, and event system. Laravel has no equivalent bundle extension point, and the package ships no Laravel service provider or auto-discovery. For Laravel you would evaluate the framework-agnostic gpslab/domain-event core instead.
Can I use gpslab/domain-event with Laravel?
Yes, the underlying gpslab/domain-event library is framework-agnostic: aggregate roots record events and a dispatcher releases them. The Symfony bundle layer is the part that does not fit Laravel. A Laravel integration means writing a ServiceProvider, collecting listeners, and forwarding released events into Laravel's dispatcher or queue. That is closer to a small rewrite than a normal Composer install.
How does gpslab/domain-event-bundle integrate with Doctrine ORM?
The bundle collects domain events recorded by Doctrine entities and dispatches them on flush, typically after data is safely persisted. That deferred, release-after-commit behavior is the valuable part of the design. Laravel applications use Eloquent rather than Doctrine entities, so this integration does not carry over. You would need to reproduce the same semantics with Eloquent model hooks and DB::afterCommit.
Does gpslab/domain-event-bundle support Laravel 10 or Laravel 11?
There is no published Laravel integration path and no Laravel package discovery in the bundle. The release notes and v2.3.1 changes cover Doctrine compatibility, CI, and README badges, not Laravel or modern PHP support. You should inspect composer.json and the CI matrix directly before assuming compatibility with Laravel 10 or 11. Expect to fork or ignore platform requirements if you try to install it.
What PHP versions does gpslab/domain-event-bundle support?
The provided assessment finds no evidence of formal PHP 8.2 or 8.3 compatibility, and the platform constraints are likely to conflict with modern stacks. The 2.3.1 release addressed Doctrine ORM 2.7 compatibility rather than PHP or framework constraints. Check the CI matrix to see whether it tests only legacy PHP ranges. Running on PHP 8.2+ may require --ignore-platform-reqs or a fork.
How do I dispatch domain events after a database transaction in Laravel?
Use Laravel's DB::afterCommit together with Laravel events, or buffer events on an aggregate trait and release them in an after-commit callback. The gpslab bundle's release-after-flush semantics are the same idea, but its implementation is tied to Doctrine and Symfony. A thin in-house layer is usually enough: record events on the aggregate, collect them, then dispatch after commit. That keeps domain logic decoupled without importing Symfony bundle glue.
How do I register listeners and subscribers for domain events?
In Symfony the bundle lets you tag listeners and subscribers as services, and compiler passes collect them automatically. Laravel does not use that compiler-pass mechanism, so you would reimplement collection with container tagging, explicit registration, or EventServiceProvider. The routing concept is straightforward, but the wiring is not reusable as delivered. Plan for custom registration code if you adopt the core library.
Is gpslab/domain-event-bundle actively maintained?
It is not dormant: v2.3.1 sits on an active 2.3.x line with tagged releases and a compare link, and GitHub Actions CI is now configured. However, it still has roughly 14 stars, zero dependents, and effectively one maintainer, with no security policy. Release cadence is unknown and five patch-level maintenance commits after a long gap are a sign of life, not proof of a sustainable schedule. Treat it as a small, single-maintainer dependency.
Should I use the bundle or a thin in-house implementation for Laravel?
For Laravel, a thin in-house implementation over DB::afterCommit plus Laravel events is usually the better fit. The useful idea is framework-agnostic, while the bundle's value is Symfony and Doctrine glue you would largely replace. The assessment estimates roughly 150 lines of your own code to cover the integration. That removes the Symfony packaging layer, the platform constraint risk, and the dependency on a single maintainer.
What are the alternatives to gpslab/domain-event-bundle for Laravel applications?
The most direct alternative is Laravel's native event dispatcher combined with DB::afterCommit and a small aggregate trait that buffers domain events. You can also keep the framework-agnostic gpslab/domain-event core and write your own Laravel adapter if you want its aggregate semantics. Either approach avoids the Symfony bundle layer and its Doctrine-specific integration. Evaluate whether you need synchronous in-process dispatch or queued out-of-process delivery before choosing.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console