From d84dc8150208f1ec0c85fd9f12c61738723c9659 Mon Sep 17 00:00:00 2001 From: novysan87 Date: Fri, 7 Aug 2026 09:28:20 +0700 Subject: [PATCH] fix(students): default urut A-Z (full_name asc) di Data Siswa --- app/Http/Controllers/StudentController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/StudentController.php b/app/Http/Controllers/StudentController.php index bda831c..b0ed3f8 100644 --- a/app/Http/Controllers/StudentController.php +++ b/app/Http/Controllers/StudentController.php @@ -43,9 +43,9 @@ class StudentController extends Controller $viewConfig = $this->resolveStudentViewConfig($viewMode, null); $status = $viewConfig['status']; - $sort = (string) $request->get('sort', 'created_at'); + $sort = (string) $request->get('sort', 'full_name'); - $direction = strtolower((string) $request->get('direction', 'desc')) === 'asc' ? 'asc' : 'desc'; + $direction = strtolower((string) $request->get('direction', $sort === 'full_name' ? 'asc' : 'desc')) === 'asc' ? 'asc' : 'desc'; $allowedSorts = [ 'full_name' => 'students.full_name',