Skip to content

Commit 060b2c0

Browse files
Fix for custom page name for collections (#2017)
* Fix for custom page name for collections * Fix page name resolution in collection pagination --------- Co-authored-by: luanfreitasdev <luanfreitas10@protonmail.com>
1 parent fdf5f68 commit 060b2c0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/DataSource/Processors/CollectionProcessor.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,9 @@ private function paginate(BaseCollection $results): LengthAwarePaginator
6363
: intval(data_get($this->component->setUp, 'footer.perPage', 10));
6464

6565
$perPage = $perPage > 0 ? $perPage : $results->count();
66+
$pageName = data_get($this->component->setUp, 'footer.pageName', 'page');
6667

67-
$page = Paginator::resolveCurrentPage('page');
68+
$page = Paginator::resolveCurrentPage($pageName);
6869

6970
return new LengthAwarePaginator(
7071
items: $results->forPage($page, $perPage),
@@ -73,7 +74,7 @@ private function paginate(BaseCollection $results): LengthAwarePaginator
7374
currentPage: $page,
7475
options: [
7576
'path' => Paginator::resolveCurrentPath(),
76-
'pageName' => 'page',
77+
'pageName' => $pageName,
7778
]
7879
);
7980
}

0 commit comments

Comments
 (0)