atournayre/entities-events-bundle
UserCreatedEvent) while listeners handle side effects (e.g., sending welcome emails, logging, or triggering downstream services).EventDispatcher.UserUpdatedEvent → database audit table).OrderShippedEvent → send tracking info).PaymentProcessedEvent → update inventory).ProductUpdatedEvent → push to Shopify).Adopt if:
entityManager->persist($entity); $dispatcher->dispatch(...)).EventDispatcher in your stack.Look Elsewhere if:
EventDispatcher)."This package lets us build a more flexible, scalable Symfony backend by automatically triggering actions (like notifications or audits) whenever data changes—without tightly coupling our code. For example, when a user signs up, we can instantly send a welcome email, log the action, and sync with our CRM—all without modifying the core user-creation logic. It’s a low-code way to add event-driven features, reducing development time and improving maintainability. The MIT license means no vendor lock-in, and it integrates cleanly with our existing Symfony stack."
*"This bundle abstracts away the boilerplate of manually dispatching events for Doctrine entity lifecycle hooks (prePersist, preUpdate, etc.). Instead of sprinkling $dispatcher->dispatch() calls across repositories, we:
HasEventsInterface (1 line of code).php bin/console atournayre:entities-events:generate-listeners).#[AsEventListener]).
Key benefits:UserEvent), reuse across listeners.EventDispatcher and Doctrine events under the hood.
Trade-offs: Adds a small dependency (MIT-licensed, archived but functional). For teams already using Symfony, this is a 50% time savings on event-driven features compared to rolling our own solution."*How can I help you explore Laravel packages today?