@php $favoritesCount = count((array) session('favorites', [])); $compareCount = count((array) session('compare', [])); $cartCount = collect((array) session('cart', []))->sum(fn ($quantity) => (int) $quantity); $companyName = config('shop.company_name', config('app.name')); $supportedLocales = (array) config('app.supported_locales', []); $currentLocale = app()->getLocale(); $currentLocaleData = $supportedLocales[$currentLocale] ?? $supportedLocales[config('app.locale', 'ru')] ?? [ 'native' => 'Русский', 'short' => 'Рус', 'flag' => '🇷🇺', ]; $navItems = [ ['label' => __('Главная'), 'route' => route('home'), 'active' => request()->routeIs('home')], [ 'label' => __('Каталог'), 'route' => route('catalog.index'), 'active' => request()->routeIs('catalog.*') || request()->routeIs('products.show') || request()->routeIs('search.index'), ], ['label' => __('О нас'), 'route' => route('pages.about'), 'active' => request()->routeIs('pages.about')], [ 'label' => __('Доставка и оплата'), 'route' => route('pages.shipping-payment'), 'active' => request()->routeIs('pages.shipping-payment'), ], ['label' => __('Контакты'), 'route' => route('pages.contacts'), 'active' => request()->routeIs('pages.contacts')], ]; @endphp
{{ __('Каталог') }}
{{ $currentLocaleData['short'] ?? strtoupper($currentLocale) }}
@foreach ($supportedLocales as $locale => $localeData)
@csrf
@endforeach
@if ($favoritesCount > 0) {{ $favoritesCount }} @endif {{ __('Избранное') }} @if ($compareCount > 0) {{ $compareCount }} @endif {{ __('Сравнение') }} @if ($cartCount > 0) {{ $cartCount }} @endif {{ __('Корзина') }} {{ auth()->check() ? __('Кабинет') : __('Войти') }}