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

zellos's avatar

Notification class cached?

Hi everyone,

I am using new Mail Notification feature from Laravel 5.3 (https://laravel.com/docs/5.3/notifications#mail-notifications)

And everything worked fine until now. I changed toMail function and deployed to production server. On local it works fine (mailtrap)

But on production it keeps using old version of MailMessage entity returned at toMail function and keeps sending old layout. I checked the code at server - it is the same as at local.

I executed these in terminal, but it didn't help:

composer dump-autoload
php artisan clear-compiled
php artisan cache:clear
php artisan view:clear
php artisan optimize

On production I am using mailgun.

Does anyone have any suggestions?

0 likes
4 replies
padrinpanji's avatar
Level 1

If you using supervisor, please restart it (sudo supervisorctl reload) Then your problem was resolved :)

9 likes
KevinMcKee's avatar

This was finally the solution for me after hours of trying to figure out what the heck was going on. Thank you! In my case I am running Horizon in my dev environment, so I just did php artisan horizon:terminate then php artisan horizon to start it back up

ecgk's avatar

What about in Laravel 5.7 & 5.8? Is that the best way? O do I have to run: php artisan queue:restart?

Because I've tried both and I have a problem. I have 3 different notifications. I update the layout and the content. Restart with supervisorctl and 2 of 3 have the right layout and the right content, the other one not. Then restart again and the first and third notification have the right content and layout but the 2nd not... and so...

What could it be?

Thanks.

Please or to participate in this conversation.