Skip to content

Commit

Permalink
Merge branch 'hotfix/fix_simple_paginator_skip' into feature/count_do…
Browse files Browse the repository at this point in the history
…cuments

* hotfix/fix_simple_paginator_skip:
  🐛 don't skip the first x documents equal to `$perPage`
  • Loading branch information
arnordhaenens committed Jan 25, 2021
2 parents 7d41e90 + de5bef4 commit 17d01e5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Query/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ public function paginate($perPage = null, $columns = ['*'], $pageName = 'page',
{
$perPage = $perPage ?: ($this->model ? $this->model->getPerPage() : 100);
$currentPage = $page ?: Paginator::resolveCurrentPage($pageName);
$items = $this->skip($perPage * $currentPage)
$items = $this->skip($perPage * ($currentPage - 1))
->limit($perPage)
->get();

Expand Down

0 comments on commit 17d01e5

Please sign in to comment.