When you need to dispatch job from tinker, the normal command which is
App\Jobs\YourJob::dispatch();
would not work in tinker because dispatch helper function depends on garbage collection. Hence to dispatch a job from tinker, use any of the following commands
\Bus::dispatch(new App\Jobs\YourJob($someArgument));
\Queue::push(new App\Jobs\YourJob($someArgument));
Discussion (0)