vendredi 2 octobre 2020

Laravel 7 Job queue handle method is not working

I am trying to execute a code after some delay using laravel 7 job queue. The constructor method is working but not the handle method. My code is given below:

Controller:

public function test()
{
    echo 'starting ....';
    $reset = (new ResetLockers())->delay(now()->addSeconds(10));
    dispatch($reset);
}

Job:

class ResetLockers implements ShouldQueue
{
    use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;

    
    public function __construct()
    {
        echo 'constructing ...';
    }

    
    public function handle()
    {
        echo 'job dispatched';
    }
}

database:

enter image description here

output:

enter image description here

any clue?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire