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

Laminas Eventmanager Laravel Package

laminas/laminas-eventmanager

Laminas EventManager provides a flexible event and listener system for PHP applications. Attach listeners, trigger events, manage priorities, and use shared event managers to coordinate decoupled components across your app.

View on GitHub
Deep Wiki
Context7

Wildcard Listeners

Sometimes you'll want to attach the same listener to all events of a given instance — or potentially, with a shared event collection, all contexts.

Attaching using the wildcard

To attach to all events on a given EventManager instance, you can use the wildcard event, *:

$events = new EventManager();
$events->attach('*', $listener);

Note that if you specify a priority, that priority will be used for this listener for any event triggered.

What the above specifies is that any event triggered by the event manager instance will result in notification of this particular listener.

Attaching using the wildcard via a SharedEventManager

Using the SharedEventManager, you can indicate that you want to attach to all events of a given identifier, a single named event across all identifiers, or all events on all identifiers.

$sharedEvents = new SharedEventManager();

// Attach to all events on the context "foo"
$sharedEvents->attach('foo', '*', $listener);

// Attach to the "foo" event of any context:
$sharedEvents->attach('*', 'foo', $listener);

// Attach to all events on all contexts:
$sharedEvents->attach('*', '*', $listener);

Note that if you specify a priority, that priority will be used for all events specified.

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
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
twbs/bootstrap4