From c6e21961c4e00c51bd4663cda6a484b9e5be9520 Mon Sep 17 00:00:00 2001 From: novysan87 Date: Fri, 24 Jul 2026 11:09:03 +0700 Subject: [PATCH] fix: only sync active students from API endpoint --- app/Http/Controllers/Api/Integration/StudentSyncController.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/Http/Controllers/Api/Integration/StudentSyncController.php b/app/Http/Controllers/Api/Integration/StudentSyncController.php index 798a9a6..0533207 100644 --- a/app/Http/Controllers/Api/Integration/StudentSyncController.php +++ b/app/Http/Controllers/Api/Integration/StudentSyncController.php @@ -19,6 +19,7 @@ class StudentSyncController extends Controller $classLevel = strtoupper(trim((string) $request->query('class_level', ''))); $items = Student::query() + ->where('status', 'active') ->when(in_array($classLevel, ['X', 'XI', 'XII'], true), function ($query) use ($classLevel) { $query->whereHas('classRoom', fn ($classQuery) => $classQuery->where('level', $classLevel)); })