Skip to content

Commit 4fe4d9f

Browse files
Pagination Perpage update
1 parent fcacfb7 commit 4fe4d9f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/Schema/Builder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1429,7 +1429,7 @@ public function get($limit = null)
14291429
/**
14301430
* Paginate the given query into a simple paginator.
14311431
*
1432-
* @param int|string $perPage Supporting numeric string values, which will be
1432+
* @param int|string|null $perPage Supporting numeric string values, which will be
14331433
* internally converted to `int`
14341434
*
14351435
* @param string $pageParam Parameter name on url

src/Schema/Pagination/Paginator.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -319,15 +319,15 @@ private function resetKeys(?array $options = [], $links = true)
319319
* Get Pagination data
320320
* @param \Tamedevelopers\Database\Schema\Builder $query
321321
* @param int $totalCount
322-
* @param int|string $perPage
322+
* @param int|string|null $perPage
323323
*
324324
* @return $this
325325
*/
326-
protected function getPagination(Builder $query, $totalCount, int|string $perPage = 15)
326+
protected function getPagination(Builder $query, $totalCount, $perPage = 15)
327327
{
328328
try {
329329
// convert to int
330-
$perPage = (int) $perPage;
330+
$perPage = (int) empty($perPage) ? 15 : $perPage;
331331

332332
// reset headers
333333
$this->asset->headerControlNoCache();

0 commit comments

Comments
 (0)