I'm trying to set up queues and jobs in a laravel project using the database queue driver and supervisor. When I dispatch a job, I get this error
exception 'InvalidArgumentException' with message 'No handler registered for command [App\Jobs\IndexUser]'
Job:
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
class IndexUser
{
use InteractsWithQueue, Queueable, SerializesModels;
Dispatch:
dispatch((new IndexUser($this->user->id, $user_status))->onQueue('index_user'));
I think it might be because of this package installed. But I cannot remove it as I am using it vastly.
laravelcollective/html
The PHP version is 5.6 and laravel version is 5.1. Updating these is not an option as it is not in my hands.
Things I tried:
When I use SelfHandling in the Job it works fine but does not use the database as driver nor supervisor which is what I want.
class IndexUser implements SelfHandling
Installing this package https://github.com/AltThree/Bus/tree/v1.1.0. But composer returns an error because the package requires higher laravel version.
Is there any way to fix this?
ShouldQueue
interface and possibly extend theApp\Jobs\Job
class – PtrTon