I am running the Artisan command from the controller in my Laravel application. As indicated in the docs , you can put the following queue:
Artisan::queue('email:send', [
'user' => 1, '--queue' => 'default'
]);
This takes care of the queue logic and, in my case, sends the job to Redis, where it is processed almost immediately.
I want to postpone the work. You can usually do this when calling the queue command as follows:
$job = (new SendReminderEmail($user))->delay(60);
$this->dispatch($job);
Is there a way to join these features so that I can delay the Artisan team for 5 minutes? I suggested that there is an easy way to set it aside.
If not, I could create another Job class to stand between my controller and the Artisan command, which I could queue in the usual way and hold, and then make this call my Artisan command. But this seems like a really confusing way to make it work. Is there a better way to delay an Artisan team in line?
thanks
source
share