@php use Illuminate\Support\Str; @endphp {{ __('header.kvda') }} {{ __('header.project_title') }} {{ __('header.urban_eba_project') }} home @foreach ($navMenus->sortBy('display_order') as $menu) @php $menuLink = $menu->external_link && Str::startsWith($menu->external_link, ['http://', 'https://']) ? $menu->external_link : url($menu->slug); $hasChildren = $menu->children->isNotEmpty(); $label = app()->getLocale() === 'np' ? $menu->name_np : $menu->name_en; @endphp {{-- No Children --}} @if (!$hasChildren) {{ $label }} @else {{-- Has Children --}} {{ $label }} @foreach ($menu->children->sortBy('display_order') as $child) @php $childLink = $child->external_link && Str::startsWith($child->external_link, ['http://', 'https://']) ? $child->external_link : url($child->slug); $childHasKids = $child->children->isNotEmpty(); $childLabel = app()->getLocale() === 'np' ? $child->name_np : $child->name_en; @endphp {{ $childLabel }} @if ($childHasKids) @endif {{-- Level 3 --}} @if ($childHasKids) @foreach ($child->children->sortBy('display_order') as $sub) @php $subLink = $sub->external_link && Str::startsWith($sub->external_link, [ 'http://', 'https://', ]) ? $sub->external_link : url($sub->slug); $subLabel = app()->getLocale() === 'np' ? $sub->name_np : $sub->name_en; @endphp {{ $subLabel }} @endforeach @endif @endforeach @endif @endforeach EN | NP KVDA-UEbA EN | NP {{ __('header.mobile_menu') }} {{ __('header.kvda') }} {{ __('header.project_title') }} home Home @foreach ($navMenus as $menu) @php $menuLink = $menu->external_link && Str::startsWith($menu->external_link, ['http://', 'https://']) ? $menu->external_link : url($menu->slug); @endphp @if ($menu->children->isEmpty()) {{ app()->getLocale() == 'np' ? $menu->name_np : $menu->name_en }} @else {{ app()->getLocale() == 'np' ? $menu->name_np : $menu->name_en }} @foreach ($menu->children as $child) @php $childLink = $child->external_link && Str::startsWith($child->external_link, ['http://', 'https://']) ? $child->external_link : url($child->slug); @endphp @if ($child->children->isEmpty()) {{ app()->getLocale() == 'np' ? $child->name_np : $child->name_en }} @else {{ app()->getLocale() == 'np' ? $child->name_np : $child->name_en }} @foreach ($child->children as $sub) @php $subLink = $sub->external_link && Str::startsWith($sub->external_link, [ 'http://', 'https://', ]) ? $sub->external_link : url($sub->slug); @endphp {{ app()->getLocale() == 'np' ? $sub->name_np : $sub->name_en }} @endforeach @endif @endforeach @endif @endforeach
|