ashleydawson/domain-event-dispatcher
Avoid if:
__invoke() magic methods and lacks PSR-15 (Middleware) or PSR-14 (Event Dispatcher) compliance, which are industry standards for event handling.Consider if:
For Executives: "This package lets us implement event-driven architecture in our domain models—decoupling core logic from side effects like notifications or analytics. It’s a lightweight, PHP-native solution that aligns with Domain-Driven Design (DDD), reducing complexity in our services and making them easier to scale or replace. Think of it as a ‘fire-and-forget’ mechanism for domain events: when something important happens in our business logic (e.g., an order is placed), we can trigger actions elsewhere without tightly coupling those systems. It’s a strategic enabler for modularity and future-proofing our architecture."
For Engineering: *"The DomainEventDispatcher is a singleton-based event bus for PHP/Laravel that lets us dispatch events from domain models directly. Key benefits:
__invoke(), so we’re not locked into interfaces.Trade-offs:
Recommendation: Use this for prototyping or greenfield DDD projects where we want to avoid Laravel’s event system. For production Laravel apps, prioritize Laravel’s native events or Symfony’s Messenger. If we proceed, we’ll need to:
How can I help you explore Laravel packages today?