justiversen / laravel-job-chainer
Chain Laravel jobs without having to glue it to a starting job
Installs: 42 988
Dependents: 0
Suggesters: 0
Security: 0
Stars: 72
Watchers: 3
Forks: 2
Open Issues: 3
Requires
- php: ^7.4|^8.0
Requires (Dev)
- orchestra/testbench: ^4.0|^6.6
- phpunit/phpunit: ^8.0|^9.3
This package is auto-updated.
Last update: 2025-05-06 12:10:58 UTC
README
Laravel Job Chainer
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();
Why?
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.
Issue
Please open a new issue, if you are experiencing any troubles.