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

LudoNvl's avatar

Job chaining in Lumen 5.6

Hi,

I try to chain multiple Jobs. My goal is to run a Job after another one finished. In Lumen 5.6, I tried to do this in my controller :

$this->dispatch(new FillBrutFec($import))->chain(new FillRaiFec());

But nothing working. I got :

Call to a member function chain() on integer

I don't know what am I doing wrong. If someone got an idea, I will be glad to use it :)

0 likes
2 replies
danMedology's avatar

You've got the chain on the return from dispatch. However, chain is on the job itself. Specifically, it's in the Illuminate\Bus\Queueable trait.

So, it should be:

$this->dispatch( (new FillBruteFec($import))->chain(new FillRaiFec()) );

Please or to participate in this conversation.