diff --git a/app/Http/Controllers/Api/ParentAuthController.php b/app/Http/Controllers/Api/ParentAuthController.php index 1ff30e2..0149394 100644 --- a/app/Http/Controllers/Api/ParentAuthController.php +++ b/app/Http/Controllers/Api/ParentAuthController.php @@ -221,7 +221,9 @@ class ParentAuthController extends Controller 'class_name' => $student->class_name, 'class_level' => $student->class_level, 'department_name' => $student->department_name, - 'photo_url' => $student->photo_path ? url($student->photo_path) : null, + 'photo_url' => $student->photo_path + ? (str_starts_with($student->photo_path, 'http') ? $student->photo_path : url($student->photo_path)) + : null, ], ]; diff --git a/app/Services/StudentSyncService.php b/app/Services/StudentSyncService.php index 238833b..973f5a2 100644 --- a/app/Services/StudentSyncService.php +++ b/app/Services/StudentSyncService.php @@ -105,7 +105,7 @@ class StudentSyncService 'department_name' => $item['department_name'] ?? '', 'academic_year_name' => $item['academic_year_name'] ?? '', 'status' => 'active', - 'photo_path' => $item['photo_path'], + 'photo_path' => $item['photo_url'] ?? $item['photo_path'], 'class_id' => $class->id, 'is_active' => true, 'synced_at' => now(),