File tree 1 file changed +8
-4
lines changed
1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -221,9 +221,11 @@ public function chain($chain)
221
221
*/
222
222
public function prependToChain ($ job )
223
223
{
224
- $ jobs = ChainedBatch::prepareNestedBatches (new Collection ([ $ job] ));
224
+ $ jobs = ChainedBatch::prepareNestedBatches (Collection:: wrap ( $ job ));
225
225
226
- $ this ->chained = Arr::prepend ($ this ->chained , $ this ->serializeJob ($ jobs ->first ()));
226
+ foreach ($ jobs ->reverse () as $ job ) {
227
+ $ this ->chained = Arr::prepend ($ this ->chained , $ this ->serializeJob ($ job ));
228
+ }
227
229
228
230
return $ this ;
229
231
}
@@ -236,9 +238,11 @@ public function prependToChain($job)
236
238
*/
237
239
public function appendToChain ($ job )
238
240
{
239
- $ jobs = ChainedBatch::prepareNestedBatches (new Collection ([ $ job] ));
241
+ $ jobs = ChainedBatch::prepareNestedBatches (Collection:: wrap ( $ job ));
240
242
241
- $ this ->chained = array_merge ($ this ->chained , [$ this ->serializeJob ($ jobs ->first ())]);
243
+ foreach ($ jobs as $ job ) {
244
+ $ this ->chained = array_merge ($ this ->chained , [$ this ->serializeJob ($ job )]);
245
+ }
242
246
243
247
return $ this ;
244
248
}
You can’t perform that action at this time.
0 commit comments