mirror of
https://github.com/archtechx/jobpipeline.git
synced 2025-12-13 12:04:04 +00:00
Add the ability to use closures inside pipelines
This commit is contained in:
parent
86873515ae
commit
f86e55ace7
3 changed files with 23 additions and 2 deletions
|
|
@ -57,7 +57,11 @@ class JobPipeline implements ShouldQueue
|
|||
public function handle(): void
|
||||
{
|
||||
foreach ($this->jobs as $job) {
|
||||
$result = app()->call([new $job(...$this->passable), 'handle']);
|
||||
if (is_string($job)) {
|
||||
$job = [new $job(...$this->passable), 'handle'];
|
||||
}
|
||||
|
||||
$result = app()->call($job);
|
||||
|
||||
if ($result === false) {
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue