{{-- ECA-style two-row header --}} @php $lc = ['locale' => app()->getLocale()]; $routeName = Route::currentRouteName(); $contactUrl = route('site.contact', $lc); $accountRequestsUrl = (($customerUnreadNotifications ?? 0) > 0 && ($customerNotificationsUrl ?? null)) ? $customerNotificationsUrl : route('site.account.requests', array_merge($lc, ['tab' => 'requests'])); $trackUrl = route('site.repair-tracking.index', $lc); $authUser = auth()->user(); $accountAvatarUrl = $authUser ? (\App\Support\UserAvatar::url($authUser->avatar) ?: \App\Support\UserAvatar::fallbackUrl((int) $authUser->id)) : null; $accountInitial = mb_substr((string) ($authUser?->name ?: $authUser?->mobile ?: '?'), 0, 1); $navProductsActive = site_nav_products_active(); $navCategoriesActive = site_nav_categories_active(); $phone = $headerPhone ?? null; $phoneHref = $headerPhoneHref ?? null; $officeOnline = (bool) ($headerOfficeOnline ?? false); $hasCategories = site_feature_enabled('categories') && isset($headerCategories) && $headerCategories->isNotEmpty(); $hasBlog = site_feature_enabled('articles_blog'); $hasNews = site_feature_enabled('news'); $showsProducts = site_shows_products(); $showsServices = site_shows_services(); $showsTracking = site_shows_tracking(); $menu = $rayanHeaderMenu ?? [ 'catalog' => [], 'columns' => [], 'featuredId' => null, 'products' => [], 'services' => [], 'articles' => [], 'news' => [], 'productsIndexUrl' => $showsProducts ? route('site.products.index', $lc) : null, 'servicesIndexUrl' => $showsServices ? route('site.services.index', $lc) : null, 'blogIndexUrl' => $hasBlog ? route('site.blog.index', $lc) : null, 'newsIndexUrl' => $hasNews ? route('site.news.index', $lc) : null, ]; @endphp
{{-- Top utility bar: scrolls away --}}
@if ($phone && $phoneHref) {{ $phone }} @endif @if ($officeOnline) @endif {{ __('site.topbar_hours') }}
@feature('header.language') @endfeature
{{-- Sticky main header --}}
{{-- Row 1: logo | search | actions --}}
@feature('header.search') @endfeature
{{-- Row 2: main page nav (desktop) --}}
@if ($hasCategories && $menu['catalog'] !== [])
@foreach ($menu['catalog'] as $item)
@if ($item['image']) @else @endif
{{ $item['title'] }}
@if ($item['excerpt'] !== '')

{{ $item['excerpt'] }}

@endif {{ __('site.mega_view_category', ['title' => $item['title']]) }}
@if ($item['children'] !== []) @endif
@endforeach
@endif @if ($showsProducts)
@include('partials.site.header-mega-cards', [ 'heading' => __('site.nav_products'), 'items' => $menu['products'], 'empty' => __('site.mega_products_empty'), 'moreUrl' => $menu['productsIndexUrl'], ])
@endif @if ($showsServices)
@include('partials.site.header-mega-cards', [ 'heading' => __('site.nav_services'), 'items' => $menu['services'], 'empty' => __('site.mega_services_empty'), 'moreUrl' => $menu['servicesIndexUrl'], ])
@endif @if ($hasBlog)
@include('partials.site.header-mega-cards', [ 'heading' => __('site.mega_articles'), 'items' => $menu['articles'], 'empty' => __('site.mega_articles_empty'), 'moreUrl' => $menu['blogIndexUrl'], ])
@endif @if ($hasNews)
@include('partials.site.header-mega-cards', [ 'heading' => __('site.nav_news'), 'items' => $menu['news'], 'empty' => __('site.mega_news_empty'), 'moreUrl' => $menu['newsIndexUrl'], ])
@endif {{-- Mobile panel --}}
{{-- /.eca-header sticky --}}