diff --git a/CHANGELOG.md b/CHANGELOG.md index d862f3c..d4b1b58 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,12 @@ Change Log ========== +2020-06-24 - 1.2.4 +------------------ + + * fix method calls when setting up pagination; calling `setCurrentPage` before `setMaxPerPage` + causes a failure with pagerfanta > 2.1.3. + 2020-05-13 - 1.2.3 ------------------ diff --git a/src/ModelBuilder.php b/src/ModelBuilder.php index b47297d..b223523 100644 --- a/src/ModelBuilder.php +++ b/src/ModelBuilder.php @@ -274,7 +274,7 @@ public function count(): int */ public function paginate(int $page = 1, int $perPage = 30): Pagerfanta { - return (new Pagerfanta(new PaginatorAdapter($this)))->setCurrentPage($page)->setMaxPerPage($perPage); + return (new Pagerfanta(new PaginatorAdapter($this)))->setMaxPerPage($perPage)->setCurrentPage($page); } /**