<nav class="sidebar sidebar-offcanvas" id="sidebar">
    <ul class="nav">
        <li class="nav-item nav-profile">
            <a href="/profile">
                <div class="nav-link">
                    <div class="profile-image">
                        {{--<img src="admin/images/faces/face10.jpg" alt="image"/>--}}
                        {{--<span class="online-status online"></span> <!--change class online to offline or busy as needed-->--}}
                    </div>
                    <div class="profile-name">
                        <p class="name">
                            {{Auth::user()->fname}} {{Auth::user()->lname}}
                        </p>
                        <p class="designation">
                            {{--Super Admin--}}
                        </p>
                    </div>
                </div>
            </a>
        </li>
        <li class="nav-item">
            <a class="nav-link" href="/admin">
                <i class="icon-rocket menu-icon"></i>
                <span class="menu-title">داشبورد</span>
            </a>
        </li>
        @foreach($sidebar as $item)
            <li class="nav-item">
                <a class="nav-link" data-toggle="collapse" href="#m{{$loop->index}}" aria-expanded="false" aria-controls="page-layouts">
                    <i class=" {{$item['icon']}} menu-icon"></i>
                    <span class="menu-title">{{$item['name']}}</span>
                    <span class="icon-arrow-down mr-auto"></span>
                </a>
                <div class="collapse" id="m{{$loop->index}}">
                    <ul class="nav flex-column sub-menu">
                        @foreach($item['subs'] as $sub)
                            @if(Auth::user()->can(app('router')->getRoutes()->match(app('request')->create('admin/'.$sub['route']))->getName()))
                            <li class="nav-item"> <a class="nav-link" href="{{url('admin/'.$sub['route'])}}">{{$sub['name']}}</a></li>
                            @endif
                        @endforeach
                    </ul>
                </div>
            </li>
        @endforeach
    </ul>
</nav>
