From de5bef41d95940ff1c7775c5ae059b8336777dda Mon Sep 17 00:00:00 2001 From: arnordhaenens Date: Mon, 25 Jan 2021 16:08:08 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20don't=20skip=20the=20first=20x?= =?UTF-8?q?=20documents=20equal=20to=20`$perPage`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Query/Builder.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Query/Builder.php b/src/Query/Builder.php index d79663c..62b977b 100644 --- a/src/Query/Builder.php +++ b/src/Query/Builder.php @@ -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();