Skip to content

Commit

Permalink
Need a clone() here because chunk() appears to change the $query inst…
Browse files Browse the repository at this point in the history
…ance
  • Loading branch information
Synchro committed Oct 16, 2024
1 parent 3f32c4f commit b57ce07
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Sheet.php
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ public function fromQuery(FromQuery $sheetExport, Worksheet $worksheet)
return;
}

$query->chunk($this->getChunkSize($sheetExport), function ($chunk) use ($sheetExport) {
$query->clone()->chunk($this->getChunkSize($sheetExport), function ($chunk) use ($sheetExport) {
$this->appendRows($chunk, $sheetExport);
});
}
Expand Down

0 comments on commit b57ce07

Please sign in to comment.