How could I dispatch one job from another in Laravel

Siddharth picture Siddharth · Feb 17, 2018 · Viewed 7.5k times · Source
Trait method dispatch has not been applied, because there are collisions with other trait methods on 

I'm always getting the above error, now I want to use both Dispatchable and DispatchJobs in a job, how could I do that? Any help or guidance will be highly appreciated. Looked for few solutions on Laracasts but none worked.

Answer

Siddharth picture Siddharth · Feb 17, 2018

Use the global dispatch() helper and that will work to dispatch another job inside the job. So we don't need to add DispatchesJobs at all (which removes the conflict with Dispatchable) and you can just use the helper dispatch() instead and it works