Framework activity

Trace Laravel events and listeners

When one action causes duplicate work, separate a repeated event dispatch from the same listener being registered more than once.

One event dispatch with a duplicate listener registration
The benchmark dispatches TripWorkspaceRefreshed once but exposes two registrations for the same listener.

Find the application event

Open Events for the originating request. Use the application filter and search for the event name. Check the occurrence count, dispatch source, sequence, and related framework activity.

An event name alone does not show which part of the application dispatched it. Follow the retained source before changing a listener.

Distinguish two common causes

Evidence Likely next check
Several dispatches of the same event Inspect repeated controller calls, model hooks, component actions, or retries that dispatch it.
One dispatch, duplicate listener registration Compare automatic discovery with explicit registration.
One listener registration, repeated job attempts Open the queued worker profiles and compare attempts.

The benchmark has a discoverable listener and also registers it explicitly:

Event::listen( TripWorkspaceRefreshed::class, RecordWorkspaceRefresh::class, );

If your application already discovers that same listener, keep one intended registration. Confirm the actual registration list before removing anything:

php artisan event:list

Read listener evidence carefully

The inspector shows registered listener metadata and the handling evidence available for the event. A registration explains who can handle it. An available completion marker describes observed handling; it does not prove an external recipient received a message or that later queued work completed.

For queued listeners, follow worker activity. For an unexpected model write or duplicate message, open Models or Mail and notifications in the profile where it happened.

Use payload shape to check the contract

Event evidence retains argument types, public field names, counts, and truncation state rather than raw payload values. This helps identify the event contract without evaluating an object graph.

If the problem depends on a value that was not retained, inspect the relevant application code or add a focused Laravel log entry with the context you need. Do not expect MCP to recover an omitted value.

Verify one logical operation

After correcting a duplicate registration, repeat the same action. Confirm one expected registration and the intended number of side effects. If the app uses a cached event manifest, refresh that manifest through the app’s normal workflow; php artisan event:clear removes a stale local event cache.

Keep separate tests for the caller dispatching the event and the listener’s behavior. Event::fake() is useful for the caller test, but a fake does not prove that a real listener ran.

Read Laravel’s event documentation for discovery and registration rules in your framework version.

Next step

Follow work sent to a queue

A queued listener may finish in a different process and profile.

Read the guide