Chain Laravel jobs without having to glue it to a starting job
justiversen/laravel-job-chainer is a Laravel package for chain laravel jobs without having to glue it to a starting job.
It currently has 72 GitHub stars and 52.021 downloads on Packagist (latest version v2.0.0).
Install it with composer require justiversen/laravel-job-chainer.
Discover more Laravel packages by justiversen
or browse all Laravel packages to compare alternatives.
Last updated
JobChainer does chain a variable amount of jobs by adding them with the add() method.
This makes it possible to chain jobs without having to know which job will be the first to be fired.
Normal job chaining
ProcessPodcast::withChain([
new OptimizePodcast,
new ReleasePodcast($argA, $argB)
])->dispatch($arg1);
With Job Chainer
$chain = new JobChainer;
$chain->add(ProcessPodcast::class, $arg1);
$chain->add(OptimizePodcast::class);
$chain->add(ReleasePodcast::class, $argA, $argB);
$chain->dispatch();
This allows us to add jobs to the chain without prior knowledge about which job would be the first. This may come in handy when jobs must be chained, but they are added dynamically to the chain.
Please open a new issue, if you are experiencing any troubles.