I am facing an issue in my Laravel project. I have created multiple databases. When a user logs in through the frontend, they have to select a company code. With this code we decide which database has to be used from the list in config/companyDb.php. This file contains all the database details for the companies. For logging in a user this all works fine, but when this is used in a job that is ran from a queue, it doesn't work.
If I run php artisan queue:all Xcompany it works for a single company, but if I run php artisan queue:all it does not work. I have to run it in the background through a custom artisan command.