When I send a job that fails due to an exception such as 'ErrorException' with message 'Undefined variable: sender'
and I fix the code and re-fire the event, the previous code runs again and I get the same error.
I have no idea why Laravel re-runs my old code over and over. I'd obviously like to be able to fix the mistakes that are breaking my job execution.
I've tried both composer dump-autoload
and php artisan queue:flush
and those have no effect. Any help?
My Laravel 5.1 config/compile.php file is empty but this helped me:
sudo service beanstalkd restart
and
php artisan queue:restart
Laravel often lacks of good and accurate documentation.
You need to run php artisan clear-compiled
to clear compiled files.
If you look at config/compile.php
you will see some extra providers (or other classes) are cached by default by Laravel.
If you made any changes for example in EventServiceProvider
and it was earlier cached, Laravel won't see those changes in case php artisan optimize
command was earlier launched (and looking at https://github.com/laravel/laravel/blob/master/composer.json you will see it is launched after running composer install
or composer update
).
This feature has nothing in common with composer itself but with Laravel that's why running composer dump-autoload
won't help.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With