Skip to content

Commit

Permalink
[8.x] Allow adding more jobs to a pending batch (#37151)
Browse files Browse the repository at this point in the history
* allow adding more jobs to a pending batch

* Update PendingBatch.php

Co-authored-by: Taylor Otwell <taylor@laravel.com>
  • Loading branch information
themsaid and taylorotwell committed Apr 28, 2021
1 parent 34aa326 commit 81330cf
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/Illuminate/Bus/PendingBatch.php
Expand Up @@ -54,6 +54,19 @@ public function __construct(Container $container, Collection $jobs)
$this->jobs = $jobs;
}

/**
* Add jobs to the batch.
*
* @param array $jobs
* @return $this
*/
public function add($jobs)
{
$this->jobs->push($jobs);

return $this;
}

/**
* Add a callback to be executed after all jobs in the batch have executed successfully.
*
Expand Down

0 comments on commit 81330cf

Please sign in to comment.