Is there any way to pass the return value of a job to the next job in the chain, or is there another easy way to pass data to the next job? Otherwise I would create a UUID beforehand and pass it to the jobs as a parameter, which they use to access a shared memory.
use AppJobsFirstJob;
use AppJobsSecondJob;
use AppJobsThirdJob;
use IlluminateSupportFacadesBus;
Bus::chain([
new FirstJob,
new SecondJob,
new ThirdJob,
])->dispatch();
2
Answers
You can pass data between jobs in a chain using the
withChain()
method.Definitely without the withChain method should work. But you have to address retries and timeout.