@if (!empty($page_init['setting']['logo']['header']))
@endif
  • @if (request()->get('lang_switch')) @foreach (request()->get('lang_switch') as $key => $value) {{ __("field.lang.short.$key") }} @endforeach @else @foreach (languages() as $key => $value) {{ __("field.lang.short.$key") }} @endforeach @endif
@php $currentPath = trim(parse_url(url()->current(), PHP_URL_PATH), '/'); $isActiveMenu = function ($url) use ($currentPath) { if (empty($url) || $url === '#') { return false; } $menuPath = trim(parse_url($url, PHP_URL_PATH), '/'); if ($menuPath === '') { return $currentPath === ''; } if ($currentPath === $menuPath) { return true; } return str_starts_with("{$currentPath}/", "{$menuPath}/"); }; @endphp
@if (!empty($page_init['menu']['header']))
    @foreach ($page_init['menu']['header'] as $item) @if ($item['id'] == 5) @php $isDropdownActive = false; if (!empty($page_init['menu']['category']['list'])) { foreach ($page_init['menu']['category']['list'] as $sub) { if ($isActiveMenu($sub['url'] ?? null)) { $isDropdownActive = true; break; } } } $isDropdownActive = $isDropdownActive || $isActiveMenu($item['url'] ?? null); @endphp
  • {{ $item['name'] ?? '' }} @if (!empty($page_init['menu']['category']['list']))
      @foreach ($page_init['menu']['category']['list'] as $subitem)
    • {{ $subitem['name'] ?? '' }}
    • @endforeach
    @endif
  • @else
  • {{ $item['name'] ?? '' }}
  • @endif @endforeach
@endif