@props([ 'route' => null, 'params' => [], // <-- Nuevo: parĂ¡metros de la ruta 'href' => null, 'icon' => null, ]) @php // Construir la URL final $url = $href ?? ($route ? route($route, $params) : '#'); // Verificar si la ruta y los parĂ¡metros coinciden $active = false; if ($route && request()->routeIs($route)) { $currentParams = request()->route()->parameters(); $active = !array_diff_assoc($params, $currentParams); } elseif ($href) { $active = request()->url() === $href; } $activeStyles = $active ? 'active' : ''; @endphp merge(['class' => "item-menu-nav $activeStyles"]) }}> @if ($icon) @endif {{ $slot }}