@php $currentSlug = request()->route('slug') ?? ($landingSlug ?? null); @endphp {{-- Expand/Collapse all --}} @if(isset($categories) && $categories->isNotEmpty())
|
{{-- Categories --}} @php $defaultOpenCat = null; if (request()->routeIs('category.show')) { $catSlug = request()->route('slug'); foreach ($categories as $cat) { if ($cat->translation($locale)?->slug === $catSlug) { $defaultOpenCat = $cat->id; break; } } if (!$defaultOpenCat && isset($excludedCategories)) { foreach ($excludedCategories as $cat) { if ($cat->translation($locale)?->slug === $catSlug) { $defaultOpenCat = $cat->id; break; } } } } if (!$defaultOpenCat) { foreach ($categories as $cat) { if ($cat->posts->contains(fn($p) => $p->translation($locale)?->slug === $currentSlug)) { $defaultOpenCat = $cat->id; break; } } } if (!$defaultOpenCat && isset($excludedCategories)) { foreach ($excludedCategories as $cat) { if ($cat->posts->contains(fn($p) => $p->translation($locale)?->slug === $currentSlug)) { $defaultOpenCat = $cat->id; break; } } } @endphp @endif {{-- Pages --}} @if(isset($pages) && $pages->isNotEmpty()) @endif {{-- Search --}}
{{-- Contact & YouTube --}}
Email YouTube