Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

amir441's avatar

Changing the Order of Event Listeners in Laravel

Hello Laravel community,

I am currently facing an issue with duplicate listeners for my PodcastProcessed event in my Laravel application. I have two listeners: SendPodcastNotification and SendPodcastNotification1. However, when I run the command php artisan event:list, I see that both listeners are being listed as duplicates.

Here is my implementation:

/**
 * Bootstrap any application services.
 */
public function boot(): void
{
    Event::listen(PodcastProcessed::class , [SendPodcastNotification1::class , 'handle']);
    Event::listen(PodcastProcessed::class , [SendPodcastNotification::class , 'handle']);
}

php artisan event:list

App\Events\PodcastProcessed ......................................................................
⇂ App\Listeners\SendPodcastNotification1@handle
⇂ App\Listeners\SendPodcastNotification@handle
⇂ App\Listeners\SendPodcastNotification@handle
⇂ App\Listeners\SendPodcastNotification1@handle

0 likes
2 replies
tykus's avatar
tykus
Best Answer
Level 104

Event discovery is enabled by default; so you are getting the auto-discovered event/listeners as well as your explicitly defined ones.

You could turn off event discovery, but it will then be turned off for all events which might be undesirable. The alternative is to remove the type-hints on the handle method parameters so discovery does not work for those listeners:

- public function handle(PodcastProcessed $event): void
+ public function handle($event): void

Please or to participate in this conversation.