Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

xmsi's avatar

xmsi wrote a reply+100 XP

5mos ago

Thanks it works in Laravel 12

xmsi's avatar

xmsi liked a comment+100 XP

5mos ago

For anyone having the same problem and coming here to find a solution - you can use one of the following methods instead to dispatch a job and get the jobId instantly:

$job = new YourJob();
$jobId = Bus::dispatch($job);
// Or
$jobId = Queue::push($job);

It's stated in the Laravel documentation for Tinker in the "usage" section (there is an info box - seems like I am not allowed to post links in here)