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

gnowak's avatar
Level 1

How to debug mail event error upon Laravel Upgrade?

I am using Laravel 11 which has been upgraded from Laravel 10 with Laravel Breeze.

When executing the event: event(new Registered($user)); two email verification mails are sent when User model implements MustVerifyEmail upon user registration.

Any ideas how to debug this further? The project is currently stuck at laravel/framework v11.8.0.

I can see that this file vendor/laravel/framework/src/Illuminate/Foundation/Console/stubs/view-mail.stub is only in version 11.9.0 and not 11.8.0. Same issue present in version 11.21.

My steps to reproduce the error:

composer require laravel/framework:11.8.0; php artisan test --filter=UserRegistrationTest
composer require laravel/framework:11.9.0; php artisan test --filter=UserRegistrationTest

Postgres 16.3 PHP 8.3.6

composer.json require:

Thank you.

0 likes
3 replies
gnowak's avatar
Level 1

I found that the event list upon upgrade gives me duplicate listeners, but I am not aware where they come from. How can I debug this further to find what causes this duplicate in the event listeners?

php artisan event:list |grep mail
  ⇂ Illuminate\Auth\Listeners\SendEmailVerificationNotification  
  ⇂ Illuminate\Auth\Listeners\SendEmailVerificationNotification  
Snapey's avatar

do you still have an entry in EventServiceProvider?

Please or to participate in this conversation.