@php
function menuItem($label, $icon, $routeName)
{
$isActive = request()->routeIs($routeName . '*');
$classes = $isActive
? 'text-blue-600 bg-blue-50 font-semibold border-l-4 border-blue-600'
: 'text-gray-700 hover:text-blue-600 hover:bg-blue-50 border-l-4 border-transparent';
$url = route($routeName . '.index'); // auto route fix
return "
{$icon}
{$label}
";
}
@endphp