Search code examples
laravellumen

Laravel/Lumen Using delay and onQueue at the same time


i want to use delay and onQueue methods at same time but i'll get error:

dispatch(new MyJob())->delay(Carbon::now()->addHours(2))->onQueue('high');

Error : Call to undefined method Laravel\Lumen\Bus\PendingDispatch::delay()

But in normal laravel app i can do this.


Solution

  • Try to use the Queueable trait in jobs