Just for context I do have 2 different Laravel projects.
- project A – this is where I dispatch certain jobs
- project B – this is where jobs being handled
I am using Laravel Homestead on my local setup, both projects are in Laravel version 10 and the Laravel Horizon is 5.16. Also take note that I only installed Laravel Horizon on project B.
As mentioned here, the command php artisan horizon should be executed on VM so I always open 2 command lines on my local setup and both are on vagrant ssh for project B’s directory, and below are the commands that I always execute:
- project B
php artisan queue:work
- project B
php artisan horizon
I also added HORIZON_PREFIX on .env file for both project A and project B as mentioned here and this key-value pair QUEUE_CONNECTION=redis
.
The jobs are being processed since it is being prompted on the command line however there are no jobs for pending and completed jobs on to Laravel Horizon dashboard. Note that there are jobs being prompted on CLI for php artisan queue:work
and CLI for php artisan horizon
. Please kindly check the attached image.
I also tried running php artisan optimize:clear
for both project A and project B.
I am confused right now. Please help.
I am expecting for the jobs to be shown on Laravel Horizon dashboard.
2
Answers
Finally!
List for pending jobs and completed jobs are now visible.
So what I did was install Laravel Horizon also on project A.
Current setup now, both project A and B have Laravel Horizon same version.
Note, I am just executing
php artisan horizon
on project B to start the process.I were struggling with this aswell, but it seems to be caused by
php artisan cache:clear
command.This command clears everything I horizon, which I personally wasn’t aware of.