@php /* |-------------------------------------------------------------------------- | School Information |-------------------------------------------------------------------------- */ $schoolName = $schoolProfile?->school_name ?? $schoolProfile?->name ?? config('app.name') ?? 'School Name'; $schoolAddress = $schoolProfile?->address ?? $schoolProfile?->school_address ?? ''; $schoolPhone = $schoolProfile?->phone ?? $schoolProfile?->mobile ?? ''; $schoolCode = $schoolProfile?->school_code ?? ''; $collegeCode = $schoolProfile?->college_code ?? ''; $schoolEiin = $schoolProfile?->eiin_number ?? ''; $schoolEmail = $schoolProfile?->email ?? ''; /* |-------------------------------------------------------------------------- | File URL Generator |-------------------------------------------------------------------------- */ $generateFileUrl = function ($filePath) { if (empty($filePath)) { return null; } if ( \Illuminate\Support\Str::startsWith( $filePath, [ 'http://', 'https://', 'data:', 'blob:', ] ) ) { return $filePath; } if (\Illuminate\Support\Str::startsWith($filePath, '/')) { return url($filePath); } return asset( 'core/storage/app/public/' . ltrim($filePath, '/') ); }; /* |-------------------------------------------------------------------------- | School Logo |-------------------------------------------------------------------------- */ $schoolLogoRaw = $schoolProfile?->logo ?? $schoolProfile?->image ?? $schoolProfile?->school_logo ?? null; $schoolLogo = $generateFileUrl($schoolLogoRaw); /* |-------------------------------------------------------------------------- | Student Information |-------------------------------------------------------------------------- */ $studentName = $student?->student_name_english ?? $student?->student_name ?? 'N/A'; $studentId = $student?->admission_roll ?? $student?->student_id ?? 'N/A'; $sessionName = $registration?->session?->name ?? 'N/A'; $className = $registration?->class?->name ?? 'N/A'; $sectionName = $registration?->section?->name ?? 'N/A'; $groupName = $registration?->group?->name ?? 'N/A'; $roll = $registration?->class_roll ?? 'N/A'; $studentSms = $student?->sms_number ?? 'N/A'; $fatherName = $student?->father_name_english ?? $student?->father_name ?? 'N/A'; $motherName = $student?->mother_name_english ?? $student?->mother_name ?? 'N/A'; $guardianName = $student?->guardian_name ?? 'N/A'; /* |-------------------------------------------------------------------------- | Student Photo |-------------------------------------------------------------------------- */ $studentPhotoRaw = $student?->student_image ?? $student?->student_photo ?? $student?->photo ?? $student?->image ?? $student?->profile_photo ?? null; $studentPhoto = $generateFileUrl($studentPhotoRaw); @endphp