{{-- 侧边栏子菜单项 --}}
@php
    $subUrl = '#';
    $isSubActive = false;

    if (isset($item['route'])) {
        $subUrl = route($item['route']);
        $isSubActive = request()->routeIs($item['route']);
    } elseif (isset($item['url'])) {
        $subUrl = $item['url'];
        $isSubActive = request()->is(trim($item['url'], '/'));
    }

    if (isset($item['active'])) {
        $isSubActive = $isSubActive || request()->is(trim($item['active'], '/'));
    }
@endphp
<li class="nav-item">
    <a href="{{ $subUrl }}"
       class="nav-link {{ $isSubActive ? 'active' : '' }}"
       @if(isset($item['target'])) target="{{ $item['target'] }}" rel="noopener noreferrer" @endif
       aria-label="{{ $item['text'] ?? '' }}">
        @if(isset($item['icon']))
            <i class="nav-icon {{ $item['icon'] }}"></i>
        @endif
        <p>{{ $item['text'] ?? '' }}</p>
    </a>
</li>