zendframework/zend-eventmanager
Zend\EventManager provides a lightweight, flexible event and listener system for PHP apps. Attach and detach listeners, trigger events with priorities, and use shared managers for cross-cutting events—ideal for decoupling components in Zend Framework and beyond.
composer require zendframework/zend-eventmanagerEventManager, EventManagerInterface, ListenerAggregateInterface, and SharedEventManagerInterfaceEventManager, attach a listener with attach(), trigger an event with trigger()src/EventManager.php and src/ListenerAggregateInterface.php for foundational APIsSharedEventManager to listen to events across multiple classes (e.g., UserCreated event triggered by both CLI and HTTP handlers)ListenerAggregateInterface for grouped, reusable listeners (cleaner than scattered attach() calls)EventManagerInterface::triggerUntil() or trigger() with callback-based listeners to early-exit on conditionsZend\EventManager\PSR14\EventWrapper)EventInterface (e.g., Event) to carry context (target object, name, params) between componentsUserEvents::CREATED) to avoid typospsr/event-dispatcher for long-term support1EventManager is configured with a SharedEventManagerInterface (common source of missing events)EventManager::setIdentifiers() to scope events per context (e.g., per-request or per-object identity)getParams()/setParams() carefully or clone objectsEventManager or use EventManagerSharedTrait in your base classes for consistent event behaviorHow can I help you explore Laravel packages today?