Skip to content

Commit 6d366d3

Browse files
committed
Add withQueryString to pagination in perKak and daftarFile methods for improved query consistency
1 parent d6ba13a commit 6d366d3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

app/Http/Controllers/ArsipController.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function perKak($token, $coa)
4949
->when($search, function ($query, $search) {
5050
return $query->where('rincian', 'like', '%'.$search.'%');
5151
})
52-
->whereIn('id', $kakIds)->paginate();
52+
->whereIn('id', $kakIds)->paginate()->withQueryString();
5353

5454
return view('arsip-per-kak', [
5555
'level' => 'KAK',
@@ -68,10 +68,10 @@ public function daftarFile($token, $kak)
6868
$page = request()->get('page', 1);
6969
$offset = ($page - 1) * $perPage;
7070
$data = array_slice($files, $offset, $perPage);
71-
$data = new \Illuminate\Pagination\LengthAwarePaginator($data, count($files), $perPage, $page, [
71+
$data = (new \Illuminate\Pagination\LengthAwarePaginator($data, count($files), $perPage, $page, [
7272
'path' => request()->url(),
7373
'query' => request()->query(),
74-
]);
74+
]))->withQueryString();
7575

7676
return view('daftar-file', [
7777
'tahun' => $tahun,

0 commit comments

Comments
 (0)