@php $user = auth()->user(); $userName = trim($user->name ?? $user->first_name ?? 'User'); $notificationsIndexRoute = match ($user->type ?? null) { 'student' => route('student.notifications.index'), 'teacher' => route('teacher.notifications.index'), 'staff' => route('admin.notifications.index'), 'social_worker' => route('social-worker.home'), 'health_visitor' => route('health-visitor.home'), default => route('admin.notifications.index'), }; $supportedLocales = config('app.supported_locales', []); $languageNames = [ 'ar' => 'العربية', 'en' => 'English', 'es' => 'Español', 'du' => 'Deutsch', 'ja' => '日本語', 'fr' => 'Français', 'zh' => '中文', ]; $userInitials = collect(preg_split('/\s+/', $userName, -1, PREG_SPLIT_NO_EMPTY)) ->take(2) ->map(fn ($part) => mb_substr($part, 0, 1)) ->implode(''); $isAr = app()->getLocale() === 'ar'; $notifCount = count(getLatestUpdatesNotifications()) + count(getLatestAlertsNotifications()); @endphp