From 81330cfec1455e733b259529e12cfc2a87a4ee00 Mon Sep 17 00:00:00 2001 From: Mohamed Said Date: Wed, 28 Apr 2021 14:55:54 +0200 Subject: [PATCH] [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 --- src/Illuminate/Bus/PendingBatch.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/Illuminate/Bus/PendingBatch.php b/src/Illuminate/Bus/PendingBatch.php index 7eab4e36112f..e9bec486292d 100644 --- a/src/Illuminate/Bus/PendingBatch.php +++ b/src/Illuminate/Bus/PendingBatch.php @@ -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. *