From 4799490ecfd3757535ab3d42f93ad170de881916 Mon Sep 17 00:00:00 2001 From: Yoga Pangestu Date: Thu, 12 Mar 2026 10:43:38 +0700 Subject: [PATCH] feat: filter out empty IDs when getting busy study group members and make the members select field live. --- app/Filament/Pages/Learning/StudyGroup/Index.php | 1 + app/Models/StudyGroup.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Filament/Pages/Learning/StudyGroup/Index.php b/app/Filament/Pages/Learning/StudyGroup/Index.php index bffe4b6..f18185f 100644 --- a/app/Filament/Pages/Learning/StudyGroup/Index.php +++ b/app/Filament/Pages/Learning/StudyGroup/Index.php @@ -148,6 +148,7 @@ public function studyGroupFormSchema(): array ->multiple() ->searchable() ->required() + ->live() ->columnSpanFull(), TextInput::make('name') diff --git a/app/Models/StudyGroup.php b/app/Models/StudyGroup.php index 3d241ae..24944bf 100644 --- a/app/Models/StudyGroup.php +++ b/app/Models/StudyGroup.php @@ -65,6 +65,6 @@ function ($q) use ($courseIds, $excludeGroupId) { ->pluck('leader_id') ->toArray(); - return array_unique(array_merge($busyMemberIds, $busyLeaderIds)); + return array_unique(array_filter(array_merge($busyMemberIds, $busyLeaderIds))); } }