Skip to content

Commit 81330cf

Browse files
[8.x] Allow adding more jobs to a pending batch (#37151)
* allow adding more jobs to a pending batch * Update PendingBatch.php Co-authored-by: Taylor Otwell <[email protected]>
1 parent 34aa326 commit 81330cf

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/Illuminate/Bus/PendingBatch.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,19 @@ public function __construct(Container $container, Collection $jobs)
5454
$this->jobs = $jobs;
5555
}
5656

57+
/**
58+
* Add jobs to the batch.
59+
*
60+
* @param array $jobs
61+
* @return $this
62+
*/
63+
public function add($jobs)
64+
{
65+
$this->jobs->push($jobs);
66+
67+
return $this;
68+
}
69+
5770
/**
5871
* Add a callback to be executed after all jobs in the batch have executed successfully.
5972
*

0 commit comments

Comments
 (0)