@php // Only keep children that still lead somewhere this user can open. $children = $menus->where('parent_id', $menu->id)->filter($hasVisibleLeaf)->values(); $active = $isMenuActive($menu); $submenuId = 'submenu-'.$menu->id; $icon = $menu->icon ?: ($depth === 0 ? 'fas fa-circle-dot' : 'fas fa-angle-right'); @endphp