Skip to content

Commit 53f97a0

Browse files
committed
clone query for chunking
1 parent 23f5a4c commit 53f97a0

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/Illuminate/Database/Query/Builder.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1847,7 +1847,9 @@ public function chunkById($count, callable $callback, $column = 'id', $alias = n
18471847
$lastId = 0;
18481848

18491849
do {
1850-
$results = $this->forPageAfterId($count, $lastId, $column)->get();
1850+
$clone = clone $this;
1851+
1852+
$results = $clone->forPageAfterId($count, $lastId, $column)->get();
18511853

18521854
$countResults = $results->count();
18531855

0 commit comments

Comments
 (0)