@php $href = \App\Helpers\Classes\Helper::hasRoute($item['route']) && $item['route_slug'] ? route($item['route'], $item['route_slug']) : route(\App\Helpers\Classes\Helper::hasRoute($item['route']) ? $item['route'] : 'default'); $is_active = $href === url()->current(); if (!$is_active) { foreach ($item['children'] as $child) { if (!Route::has($child['route'])) { continue; } $child_href = $child['route_slug'] ? route($child['route'], $child['route_slug']) : route($child['route']); $child_is_active = $child_href === url()->current(); if ($child_is_active) { $is_active = true; break; } } } @endphp @foreach ($item['children'] as $child) @php $key = data_get($child, 'key'); @endphp @if (\App\Helpers\Classes\PlanHelper::planMenuCheck($userPlan, $key)) @if (data_get($child, 'show_condition', true) && data_get($item, 'is_active')) @php $child_href = $child['route_slug'] && \App\Helpers\Classes\Helper::hasRoute($child['route']) ? route($child['route'], $child['route_slug']) : route(\App\Helpers\Classes\Helper::hasRoute($child['route']) ? $child['route'] : 'default'); $child_is_active = $child_href === url()->current(); @endphp @endif @endif @endforeach