From ba07b1048fefd816d68fe149ef1cd273062d9c25 Mon Sep 17 00:00:00 2001 From: Mohamed Said Date: Wed, 28 Apr 2021 12:38:20 +0200 Subject: [PATCH 1/2] allow adding more jobs to a pending batch --- 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..38d5773918c0 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 a 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. * From 1b9537d27fd55a90a695a3aab480389acdc50394 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Wed, 28 Apr 2021 07:55:34 -0500 Subject: [PATCH 2/2] Update PendingBatch.php --- src/Illuminate/Bus/PendingBatch.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Illuminate/Bus/PendingBatch.php b/src/Illuminate/Bus/PendingBatch.php index 38d5773918c0..e9bec486292d 100644 --- a/src/Illuminate/Bus/PendingBatch.php +++ b/src/Illuminate/Bus/PendingBatch.php @@ -55,7 +55,7 @@ public function __construct(Container $container, Collection $jobs) } /** - * Add a jobs to the batch. + * Add jobs to the batch. * * @param array $jobs * @return $this