// You can disaptch a job with queue name as following
dispatch(new YourJob())->onQueue('my_queue');
// to make it work
php artisan queue:work --queue=my_queue
Queue::before(function (JobProcessing $event) {
$jsonpayload = $event->job->payload();
if ($jsonpayload['data']['commandName'] === 'AppJobsSendAlert') {
$data = unserialize($jsonpayload['data']['command']);
$user = DB::table('users')->where('id','=',$data->test->user_id)->first();
$pay = DB::table('donates')->where('user_id','=',$user->id)->where('status','=','0')->first();
if(!is_null($pay)) {
$event->job->release(Carbon::now()->addSeconds(60));
}
}
});
ProcessPodcast::dispatch($podcast)->beforeCommit();