From 7e8b395dc559ba9c154cb59b31d212dbf4e09bb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Denis=20Duli=C3=A7i?= Date: Tue, 19 Jul 2022 10:23:51 +0300 Subject: [PATCH] formatting pagination --- app/View/Components/Contacts/Show/Content.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/View/Components/Contacts/Show/Content.php b/app/View/Components/Contacts/Show/Content.php index f1bd76941..03d278578 100644 --- a/app/View/Components/Contacts/Show/Content.php +++ b/app/View/Components/Contacts/Show/Content.php @@ -74,9 +74,8 @@ class Content extends Component $this->totals = $totals; - $limit = (int) request('limit', setting('default.list_limit', '25')); - $this->transactions = $this->paginate($this->transactions->sortByDesc('paid_at'), $limit); - $this->documents = $this->paginate($this->documents->sortByDesc('issued_at'), $limit); + $this->transactions = $this->paginate($this->transactions->sortByDesc('paid_at')); + $this->documents = $this->paginate($this->documents->sortByDesc('issued_at')); return view('components.contacts.show.content'); } @@ -91,7 +90,7 @@ class Content extends Component * * @return LengthAwarePaginator */ - public function paginate($items, $perPage = 15, $page = null, $options = []) + public function paginate($items, $perPage = null, $page = null, $options = []) { $perPage = $perPage ?: (int) request('limit', setting('default.list_limit', '25'));