Commit fdf7f67b authored by Hamid Alaei Varnosfaderani's avatar Hamid Alaei Varnosfaderani Committed by Jens Segers

fix chunkById for types other than ObjectId and laravel >= 5.6.25 (#1543)

parent e998cd0a
...@@ -633,12 +633,6 @@ class Builder extends BaseBuilder ...@@ -633,12 +633,6 @@ class Builder extends BaseBuilder
*/ */
public function forPageAfterId($perPage = 15, $lastId = 0, $column = '_id') public function forPageAfterId($perPage = 15, $lastId = 0, $column = '_id')
{ {
// When using ObjectIDs to paginate, we need to use a hex string as the
// "minimum" ID rather than the integer zero so the '$lt' query works.
if ($column === '_id' && $lastId === 0) {
$lastId = '000000000000000000000000';
}
return parent::forPageAfterId($perPage, $lastId, $column); return parent::forPageAfterId($perPage, $lastId, $column);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment