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

Domain Event Laravel Package

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.

Deep Wiki
Context7

gpslab/domain-event is a lightweight PHP library for implementing domain events cleanly in domain-driven design. It provides a simple event dispatcher and event bus so aggregates can record events that are later released and handled by listeners, keeping your domain model decoupled from infrastructure.

  • PSR-friendly event dispatcher with listener and subscriber support
  • Deferred events: record inside entities, release after persistence
  • Typed event classes with priority-based listener execution
  • Framework-agnostic core with optional integrations
  • Minimal, testable API that is easy to extend
Frequently asked questions about Domain Event
How do I install gpslab/domain-event in a Laravel application?
Install it with Composer using gpslab/domain-event, then wire its event bus and contracts into your Laravel app through a service provider or adapter. There is no evidence of first-party Laravel integration, so expect to write the bridge yourself. Audit the Composer constraints first to confirm it supports your target PHP and Laravel versions.
Does gpslab/domain-event support Laravel 10 or Laravel 11?
There is no evidence of first-party Laravel 10 or Laravel 11 support, and the package has had no release since 2019. You should run a compatibility spike on your exact Laravel and PHP matrix before adopting it. If Composer constraints block modern versions, fork and patch the package or keep it behind an internal interface.
What is the difference between gpslab/domain-event and Laravel's event dispatcher?
gpslab/domain-event is a framework-agnostic domain-event and event-bus library intended for DDD domain layers. Laravel's dispatcher is mature application infrastructure with listeners, queues, and framework integration. Use the package only if you explicitly want domain events that do not depend on Illuminate types, then adapt them to Laravel events where needed.
How do I integrate gpslab/domain-event with Laravel?
Define an internal domain-event bus port, bind it in a Laravel service provider, and implement an adapter that maps domain events to Laravel's dispatcher, listeners, and queues. Keep Illuminate classes out of your domain code. Dispatch after the database transaction commits, or use an outbox when reliable publication matters.
Can gpslab/domain-event dispatch events asynchronously to Laravel queues?
The package is likely synchronous and in-process by default, so asynchronous dispatch requires your own Laravel adapter. The package alone should not be expected to provide queue retries, ordering, dead-letter handling, or an outbox. Write contract tests that verify both synchronous and queued behavior before relying on it in production.
Is gpslab/domain-event safe for production use?
Treat it as high risk: it has 18 stars, an unknown repository, and no release since 2019-08-06, so it is effectively unmaintained. If you adopt it, audit the source, pin the exact version, and budget internal ownership for PHP and Laravel compatibility patches. For reliable production messaging, add transaction-safe dispatch, idempotent listeners, retries, and preferably an outbox.
Does gpslab/domain-event work with PHP 8?
That is unclear from the available context because the last release was in 2019 and there is no evidence of PHP 8 compatibility testing. Run a compatibility spike on your target PHP version and inspect the Composer constraints. If they block modern PHP, fork and patch the package rather than depending on upstream fixes.
How are domain events recorded on aggregates with gpslab/domain-event?
The package is described as domain-event plumbing that lets you raise, record, and dispatch events through a simple event bus. The exact API for recording events on aggregate roots should be confirmed in the source, because the available overview does not show it. If aggregate recording is missing, add an internal trait or port rather than leaking framework code into your domain.
What are alternatives to gpslab/domain-event for Laravel DDD?
Laravel's native events, listeners, and queues are the default alternative and are already mature. For framework-agnostic domain events, compare Symfony EventDispatcher or Messenger, or build a small internal domain-event bus behind your own interface. Use gpslab/domain-event only when its domain-layer abstraction is clearly worth the maintenance cost.
Should we fork gpslab/domain-event or replace it?
Pilot it in one bounded context first, then audit the source, tests, and Composer constraints. If the spike succeeds, vendor or fork the package into an internal namespace and document an exit strategy; otherwise replace it with an internal domain-event interface and a Laravel adapter. The MIT license allows a fork, but that transfers maintenance and security ownership to your team.
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