Skip to content

Commit e434a86

Browse files
committed
🐛 null limit for laravel 11
1 parent 06b680d commit e434a86

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Actions/DispatchAction.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ function ($chunk, $page) use ($limit, $chunkCount) {
142142

143143
// This is to remove for Laravel 12, chunking with limit does not work
144144
// in Laravel 11
145-
if ($page * $chunkCount >= $limit) {
145+
if (!is_null($limit) && $page * $chunkCount >= $limit) {
146146
$collection = $collection->take($limit - ($page - 1) * $chunkCount);
147147
$this->forModels($collection);
148148
return false;

0 commit comments

Comments
 (0)