From 01b3627cc2ca1a084c61f2b89471d0c2f3fd8348 Mon Sep 17 00:00:00 2001 From: Yoga Pangestu Date: Wed, 11 Mar 2026 07:42:15 +0700 Subject: [PATCH] refactor: Simplify course selection options in schedule form by directly retrieving all courses and adding options limit. --- .../Pages/Information/CourseSchedule/Index.php | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/app/Filament/Pages/Information/CourseSchedule/Index.php b/app/Filament/Pages/Information/CourseSchedule/Index.php index 2922ee0..53d7dc5 100644 --- a/app/Filament/Pages/Information/CourseSchedule/Index.php +++ b/app/Filament/Pages/Information/CourseSchedule/Index.php @@ -156,16 +156,7 @@ public function scheduleFormSchema(): array Select::make('course_id') ->label('Mata Kuliah') ->options(function () { - $user = auth()->user(); - $lecturer = $user->lecturer; - - if ($lecturer) { - $courses = Course::getOptionsForLecturer($lecturer); - } else { - $courses = Course::all(); - } - - return $courses + return Course::all() ->groupBy('semester') ->mapWithKeys(function ($courses, $semester) { return [ @@ -177,7 +168,8 @@ public function scheduleFormSchema(): array ->searchable() ->live() ->required() - ->columnSpanFull(), + ->columnSpanFull() + ->optionsLimit(100), Grid::make(3) ->schema([