Skip to content

Commit 1d3ff22

Browse files
committed
Update pagination limit in daftarFile method to improve file retrieval performance
1 parent 707712a commit 1d3ff22

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app/Http/Controllers/ArsipController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,14 @@ public function daftarFile($token, $kak)
6464
$tahun = ShareLink::where('token', $token)->first()->tahun;
6565
$path = $tahun.'/'.'arsip-dokumens'.'/'.$kak;
6666
$files = Storage::disk('arsip')->files($path);
67-
$perPage = 2;
67+
$perPage = 15;
6868
$page = request()->get('page', 1);
6969
$offset = ($page - 1) * $perPage;
7070
$data = array_slice($files, $offset, $perPage);
7171
$data = (new \Illuminate\Pagination\LengthAwarePaginator($data, count($files), $perPage, $page, [
7272
'path' => request()->url(),
7373
'query' => request()->query(),
74-
]))->withQueryString();
74+
]));
7575

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

0 commit comments

Comments
 (0)