@php $userMenus = Session::get('user_menus');
 @endphp
<div class="sidebar">
    <ul class="sidebar-ul">
        @if(!empty(Session::get('user_menus')))
            @foreach($userMenus as $menu)
                @if ($menu->children->isNotEmpty())
                    <li class="sidebar-li-rl">
                        <a href="javascript:void(0)"><i class="{{$menu->icon}}"></i> <span class="collapse-span">{{$menu->label}}</span></a>
                        <ul class="sidebar-ul-child">
                            @foreach($menu->children as $child)
                                <li><a href="{{route($child->route)}}">{{$child->label}}</a></li>
                            @endforeach
                        </ul>
                    </li>
                @else
                    <li class="{{ request()->routeIs($menu->route) ? 'active' : '' }}">
                        <a href="{{route($menu->route)}}"><i class="{{$menu->icon}}"></i> <span class="collapse-span">{{$menu->label}}</span></a>
                    </li>
                @endif
            @endforeach
        @endif
    </ul>
</div>
