@once @endonce @php $headerCustomer = $frontendCustomer ?? null; if (! $headerCustomer instanceof \App\Models\CustomerProfile && session()->has('frontend_customer_id')) { $headerCustomer = \App\Models\CustomerProfile::query()->find(session('frontend_customer_id')); } $headerCustomerLabel = null; $headerCustomerRoute = route('frontend.customer.login'); if ($headerCustomer instanceof \App\Models\CustomerProfile) { $headerCustomerLabel = $headerCustomer->name ?: $headerCustomer->mobile; $headerCustomerRoute = $headerCustomer->isProfileComplete() ? route('frontend.customer.dashboard') : route('frontend.customer.profile'); } $headerProvider = $frontendProvider ?? null; if (! $headerProvider instanceof \App\Models\ProviderProfile && session()->has('frontend_provider_id')) { $headerProvider = \App\Models\ProviderProfile::query()->find(session('frontend_provider_id')); } $headerProviderLabel = null; $headerProviderRoute = route('frontend.provider.login'); if ($headerProvider instanceof \App\Models\ProviderProfile) { $headerProviderLabel = $headerProvider->business_name ?: ($headerProvider->name ?: $headerProvider->mobile); $headerProviderRoute = $headerProvider->isProfileComplete() ? route('frontend.provider.dashboard') : route('frontend.provider.profile'); } $activeCategoryType = request()->routeIs('frontend.category-list') ? request()->route('type') : null; $activeCategoryType = [ 'job' => 'jobs', 'rent' => 'rentals', 'rental' => 'rentals', 'hostel' => 'hostels', 'service' => 'services', ][$activeCategoryType] ?? $activeCategoryType; $headerProviderComplete = $headerProvider instanceof \App\Models\ProviderProfile ? $headerProvider->isProfileComplete() : false; $headerCustomerComplete = $headerCustomer instanceof \App\Models\CustomerProfile ? $headerCustomer->isProfileComplete() : false; if ($headerProvider instanceof \App\Models\ProviderProfile) { $bottomNavItems = [ ['label' => 'Home', 'icon' => 'home', 'href' => $headerProviderComplete ? route('frontend.provider.dashboard') : route('frontend.provider.profile'), 'active' => request()->routeIs('frontend.provider.dashboard')], ['label' => 'Listings', 'icon' => 'list_alt', 'href' => $headerProviderComplete ? route('frontend.provider.lists') : route('frontend.provider.profile'), 'active' => request()->routeIs('frontend.provider.lists*')], ['label' => 'Add', 'icon' => 'add', 'href' => $headerProviderComplete ? route('frontend.provider.add-list') : route('frontend.provider.profile'), 'active' => request()->routeIs('frontend.provider.add-list'), 'primary' => true], ['label' => 'Reviews', 'icon' => 'reviews', 'href' => $headerProviderComplete ? route('frontend.provider.reviews') : route('frontend.provider.profile'), 'active' => request()->routeIs('frontend.provider.reviews*')], ['label' => 'Subs', 'icon' => 'credit_card', 'href' => $headerProviderComplete ? route('frontend.provider.subscription') : route('frontend.provider.profile'), 'active' => request()->routeIs('frontend.provider.subscription*')], ]; } elseif ($headerCustomer instanceof \App\Models\CustomerProfile) { $bottomNavItems = [ ['label' => 'Home', 'icon' => 'home', 'href' => $headerCustomerComplete ? route('frontend.customer.dashboard') : route('frontend.customer.profile'), 'active' => request()->routeIs('frontend.customer.dashboard')], ['label' => 'Saved', 'icon' => 'bookmark', 'href' => $headerCustomerComplete ? route('frontend.customer.saved') : route('frontend.customer.profile'), 'active' => request()->routeIs('frontend.customer.saved')], ['label' => 'Explore', 'icon' => 'search', 'href' => route('frontend.category-list'), 'active' => request()->routeIs('frontend.category-list')], ['label' => 'Profile', 'icon' => 'person', 'href' => route('frontend.customer.profile'), 'active' => request()->routeIs('frontend.customer.profile'), 'primary' => true], ]; } else { $bottomNavItems = [ ['label' => 'Home', 'icon' => 'home', 'href' => route('frontend.home'), 'active' => request()->routeIs('frontend.home')], ['label' => 'Explore', 'icon' => 'search', 'href' => route('frontend.category-list'), 'active' => request()->routeIs('frontend.category-list') && ! $activeCategoryType], ['label' => 'Jobs', 'icon' => 'work', 'href' => route('frontend.category-list', ['type' => 'jobs']), 'active' => $activeCategoryType === 'jobs', 'primary' => true], ['label' => 'Provider', 'icon' => 'storefront', 'href' => route('frontend.provider.login'), 'active' => request()->routeIs('frontend.provider.login')], ['label' => 'Sign up', 'icon' => 'person_add', 'href' => route('frontend.customer.login'), 'active' => request()->routeIs('frontend.customer.login')], ]; } @endphp Fily Home Explore Jobs Rentals Services Pricing Contact @if ($headerCustomer instanceof \App\Models\CustomerProfile) Hello, {{ $headerCustomerLabel }} Customer person Website homeHome searchExplore workJobs apartmentRentals design_servicesServices paymentsPricing support_agentContact Account personProfile @csrf logoutLogout @elseif ($headerProvider instanceof \App\Models\ProviderProfile) Hello, {{ $headerProviderLabel }} Provider storefront Website homeHome searchExplore workJobs apartmentRentals design_servicesServices paymentsPricing support_agentContact Account storefrontProfile @csrf logoutLogout @else Be Provider Sign in @endif @foreach ($bottomNavItems as $item) @if (! empty($item['primary'])) {{ $item['icon'] }} @else {{ $item['icon'] }} @endif {{ $item['label'] }} @endforeach