Weave Code
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

Event Dispatcher Laravel Package

psr/event-dispatcher

PSR-14 interfaces for event dispatching in PHP. Defines standard contracts for dispatchers, listeners, and providers to enable interoperability between frameworks and libraries. Not an implementation—use a compatible PSR-14 dispatcher package.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit: The package provides standardized interfaces for event handling, enabling strict decoupling between components and frameworks. It fits modern microservices or polyglot architectures by allowing consistent event communication across diverse services (e.g., Laravel, Symfony, custom systems) without vendor lock-in. Ideal for scenarios requiring third-party library interoperability or multi-framework integration.

Integration feasibility: High feasibility for PHP projects using PSR-14-compliant implementations (e.g., Laravel 8+, Symfony). Requires installing a concrete dispatcher (e.g., symfony/event-dispatcher) alongside the interfaces. Integration is trivial in Laravel due to native PSR-14 support but demands careful dependency management for non-standard setups.

Technical risk: Low for core functionality but high for misuse—teams may install only the interface package without a dispatcher implementation, causing runtime errors. Secondary risks include inconsistent event handling across teams if implementations diverge (e.g., synchronous vs. async dispatchers), and legacy system incompatibility if existing event logic relies on non-PSR patterns.

Key questions:

  • Which concrete dispatcher implementation will we adopt (e.g., Symfony’s, Laravel’s, or custom)?
  • How will we handle existing non-PSR event systems during migration?
  • How do we enforce consistent usage of StoppableEventInterface/ListenerProviderInterface across teams?
  • Will third-party dependencies we rely on support PSR-14, or require adapter layers?

Integration Approach

Stack fit: Perfect for Laravel stacks (v8+), as its Event facade and EventServiceProvider natively implement PSR-14. Also compatible with Symfony, Laminas, and custom PHP applications. Fits monolithic or microservice architectures where event-driven communication between services is required.

Migration path:

  1. Install psr/event-dispatcher and a dispatcher implementation (e.g., symfony/event-dispatcher).
  2. Gradually replace Laravel’s Illuminate\Contracts\Events\Dispatcher type-hints with Psr\EventDispatcher\EventDispatcherInterface in new services.
  3. Refactor legacy event listeners to implement Psr\EventDispatcher\ListenerProviderInterface or use __invoke-based listeners.
  4. Deprecate Event::listen() calls in favor of PSR-compliant dispatching patterns.

Compatibility: Fully compatible with PHP 7.2+ and all PSR-14-compliant frameworks. Works alongside Laravel’s native event

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.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport