#undefined function dispatchIf

10 messages · Page 1 of 1 (latest)

dull geyser
#

Hello, I made a new job in a recent Laravel 9 project. I'm doing some batch processing inside the job, and recursively calling the job from inside the job.

When I call OnboardRSDLocationJob:dispatchIf($update), it's failing, saying undefined function dispatchIf. The job has the Dispatchable trait, and I've verified that dispatchIf() exists in the Dispatchable definition.

I have a Laravel 8 project where this pattern works, so I'm confused as to why it's not working in the new project. Any insight would be much appreciated!

earnest tapir
#

You only have one colon.

#

Share your actual code.

dull geyser
#

that was it! smh... Thank you so much, this was killing me 🙂

earnest tapir
#

No problem, lol. I didn't expect that to be the solution - I just assumed it was a typo when you retyped your code.

dull geyser
#

haha nope, it was a copy pasta

#

I want to tag this solved, but I'm a discord newb and can't see how to add a tag...

earnest tapir
#

I don't know either tbh, never made one lol

spare zealot
earnest tapir
#

Of course fellow human being, it is perfectly normal for us to have only one colon.