@php $currentRouteName = request()->route()?->getName() ?? ''; $isArabic = app()->getLocale() === 'ar'; $headerIcon = 'fa-grid-2'; $dashboardHomeRoute = auth()->user()?->isSocialCareUser() ? route('social-worker.home') : match (auth()->user()->type ?? null) { 'student' => route('student.home'), 'teacher' => route('teacher.home'), 'staff' => route('admin.home'), 'health_visitor' => route('health-visitor.home'), 'parent' => route('parent.home'), default => route('admin.home'), }; $isSubjectHead = auth()->user()?->hasRole('subject_head'); $isParentPortal = (auth()->user()->type ?? null) === 'parent'; $roleLabel = auth()->user()?->isSocialCareUser() ? (app()->getLocale() === 'ar' ? 'بوابة الأخصائي الاجتماعي' : 'Social Care Portal') : match (auth()->user()->type ?? null) { 'student' => (app()->getLocale() === 'ar' ? 'بوابة الطالب' : 'Student Portal'), 'teacher' => $isSubjectHead ? (app()->getLocale() === 'ar' ? 'بوابة رئيس القسم' : 'Subject Head Portal') : (app()->getLocale() === 'ar' ? 'بوابة المعلم' : 'Teacher Portal'), 'staff' => (app()->getLocale() === 'ar' ? 'لوحة الإدارة' : 'Admin Panel'), 'health_visitor'=> (app()->getLocale() === 'ar' ? 'بوابة الرعاية الصحية' : 'Health Visitor Portal'), 'parent' => (app()->getLocale() === 'ar' ? 'بوابة ولي الأمر' : 'Parent Portal'), default => (app()->getLocale() === 'ar' ? 'لوحة الإدارة' : 'Admin Panel'), }; $headerIconMap = [ 'home' => 'fa-house', 'dashboard' => 'fa-house', 'notification' => 'fa-bell', 'certificate' => 'fa-award', 'gamification' => 'fa-trophy', 'reward' => 'fa-trophy', 'evaluation' => 'fa-file-signature', 'year' => 'fa-calendar-days', 'term' => 'fa-calendar-days', 'stage' => 'fa-calendar-days', 'grade' => 'fa-calendar-days', 'department' => 'fa-building', 'class' => 'fa-school', 'schedule' => 'fa-calendar-week', 'course' => 'fa-book-open', 'subject' => 'fa-book-open', 'question' => 'fa-database', 'quiz' => 'fa-clipboard-question', 'mark' => 'fa-square-poll-vertical', 'student' => 'fa-user-graduate', 'teacher' => 'fa-chalkboard-user', 'moderator' => 'fa-user-shield', 'role' => 'fa-user-tag', 'setting' => 'fa-gear', 'profile' => 'fa-user', 'attendance' => 'fa-user-check', 'assignment' => 'fa-clipboard-list', 'material' => 'fa-folder-open', 'lesson' => 'fa-book-bookmark', 'report' => 'fa-chart-column', 'virtual_class' => 'fa-video', 'inquiry' => 'fa-circle-question', 'parent' => 'fa-people-roof', ]; foreach ($headerIconMap as $pattern => $icon) { if (str_contains($currentRouteName, $pattern)) { $headerIcon = $icon; break; } } @endphp