Sometimes when working with jobs and queues in Laravel, you may run into an issue where you change your queue connection from sync to database, but your jobs still run synchronously β or nothing works as expected.
In many cases, this happens because of Laravelβs configuration caching system.
Even though you updated your .env file:
QUEUE_CONNECTION=database
Laravel may still be using the cached configuration.
β Solution:
Simply run the following commands:
php artisan config:clear
php artisan queue:restart
This clears the cached configuration and restarts the queue workers so the changes take effect.
After that, your queue should correctly use the database driver.
Happy coding! π
Top comments (0)