    @if (Auth::user() AND !empty($roles_check->roles))

      <!-- Main sidebar -->
      <div class="sidebar sidebar-light sidebar-main sidebar-expand-md">
        <!-- Sidebar mobile toggler -->
        <div class="sidebar-mobile-toggler text-center">
          <a href="#" class="sidebar-mobile-main-toggle">
            <i class="icon-arrow-left8"></i>
          </a>
          Navigation
          <a href="#" class="sidebar-mobile-expand">
            <i class="icon-screen-full"></i>
            <i class="icon-screen-normal"></i>
          </a>
        </div>
        <!-- /sidebar mobile toggler -->


        <!-- Sidebar content -->
        <div class="sidebar-content">

          <!-- User menu -->
          <div class="sidebar-user-material">

            <div class="sidebar-user-material-body">
              <div class="card-body text-center" style="background-color: rgba(0,0,0,.25);">
                <a href="#">
                  <img src="{!! asset('storage/'.Auth::user()->src_file) !!}" class="img-fluid rounded-circle shadow-1 mb-3" width="80" height="80" alt="">
                </a>
                <h6 class="mb-0 text-white text-shadow-dark"> {{ Auth::user()->name }} </h6>
                  <small class="text-white text-shadow-dark">(Admin)</small>
              </div>
                            
              <div class="sidebar-user-material-footer">
                <a href="#user-nav" class="d-flex justify-content-between align-items-center text-shadow-dark dropdown-toggle" data-toggle="collapse"><span>Mis Ajustes</span></a>
              </div>
            </div>

            <div class="collapse" id="user-nav">
              <ul class="nav nav-sidebar">
                  <li class="nav-item">
                    <a href="{{ url('profile') }}" class="nav-link">
                      <i class="icon-user-plus"></i>
                      <span>Mi perfil</span>
                    </a>
                  </li>
                @role('administrator')

                  <li class="nav-item">
                    <a href="{{ url('config') }}" class="nav-link">
                      <i class="icon-cog3"></i>
                      <span>Configuracion del sistema</span>
                    </a>
                  </li>
                  <li class="nav-item">
                    <a href="{{ url('moduleinstall') }}" class="nav-link">
                      <i class="icon-cog3"></i>
                      <span>Instalar modulos</span>
                    </a>
                  </li>
                  <li class="nav-item nav-item-submenu">
                    <a href="#" class="nav-link"><i class="icon-stack"></i> <span>Plantilla</span></a>
                    <ul class="nav nav-group-sub" data-submenu-title="Starter kit">
                      <li class="nav-item"><a href="{{ url('template/') }}" class="nav-link">Menu</a></li>
                    </ul>
                  </li>
                  <li class="nav-item nav-item-submenu">
                    <a href="#" class="nav-link"><i class="icon-cog3"></i> <span>Usuarios</span></a>

                     <ul class="nav nav-group-sub" data-submenu-title="Starter kit">
                      
                        <li class="nav-item"><a href="{{ url('user') }}" class="nav-link">Usuarios</a></li>

                        <li class="nav-item"><a href="{{ url('user/config/roles') }}" class="nav-link">Roles</a></li>

                        <li class="nav-item"><a href="{{ url('user/config/permission') }}" class="nav-link">Permisos</a></li>

                        <li class="nav-item"><a href="{{ url('user/config/modules') }}" class="nav-link">Modules</a></li>
                    </ul>
                  </li>
                @else

                @endrole
               
                <li class="nav-item">
                  <a href="#" class="nav-link">
                    <i class="icon-switch2"></i>
                    <span>Logout</span>
                  </a>
                </li>
              </ul>
            </div>
          </div>
          <!-- /user menu -->


          <!-- Main navigation -->
          <div class="card card-sidebar-mobile">
            <ul class="nav nav-sidebar" data-nav-type="accordion">

              <!-- Main -->
              <!--li class="nav-item-header"><div class="text-uppercase font-size-xs line-height-xs">Main</div> <i class="icon-menu" title="Main"></i></li-->
              <!--li class="nav-item">
                <a href="{{ url('home/') }}" class="nav-link {{ (request()->is('home')) ? 'active' : '' }}" >
                  <i class="icon-home4"></i>
                  <span>
                    Inicio
                  </span>
                </a>
              </li-->
              @if(empty(env('APP_EXCERPT')))
                <li class="nav-item">
                  <a href="{{ url('compras') }}" class="nav-link {{ (request()->is('compras*')) ? 'active' : '' }}" >
                    <i class="icon-cart5"></i>
                    <span>
                      Compras
                    </span>
                  </a>
                </li>
                <li class="nav-item">
                  <a href="{{ url('ventas') }}" class="nav-link {{ (request()->is('ventas*')) ? 'active' : '' }}" >
                    <i class="icon-cart-remove"></i>
                    <span>
                      Ventas
                    </span>
                  </a>
                </li>

                <li class="nav-item">
                  <a href="{{ url('rphonorarios') }}" class="nav-link {{ (request()->is('rphonorarios*')) ? 'active' : '' }}" >
                    <i class="icon-cart-remove"></i>
                    <span>
                      Recibo por honorarios
                    </span>
                  </a>
                </li>
                <li class="nav-item nav-item-submenu sub_utilitys">
                  <a href="#" class="nav-link"><i class="icon-stack"></i> <span>Utilitarios</span></a>
                  <ul class="nav nav-group-sub" data-submenu-title="Starter kit">
                    <li class="nav-item"><a href="{{ url('forpag') }}" class="nav-link {{ (request()->is('forpag*')) ? 'active' : '' }}">Formas de pago</a></li>
                    <li class="nav-item"><a href="{{ url('tcambio') }}" class="nav-link {{ (request()->is('tcambio*')) ? 'active' : '' }}">Tipo de  cambio</a></li>

                    <li class="nav-item"><a href="{{ url('divisas/') }}" class="nav-link {{ (request()->is('divisas*')) ? 'active' : '' }}">Divisas</a></li>
                    <!--li class="nav-item"><a href="{{ url('eventos_operation') }}" class="nav-link {{ (request()->is('eventos_operation*')) ? 'active' : '' }}">Eventos contables</a></li-->
                    <li class="nav-item"><a href="{{ url('articulos') }}" class="nav-link {{ (request()->is('articulos*')) ? 'active' : '' }}">Articulos</a></li>

                    <li class="nav-item"><a href="{{ url('art_familia') }}" class="nav-link {{ (request()->is('art_familia*')) ? 'active' : '' }}">Familias art</a></li>

                    <li class="nav-item"><a href="{{ url('tag_art') }}" class="nav-link {{ (request()->is('tag_art*')) ? 'active' : '' }}">Tag art</a></li>
                  </ul>
                </li>
              @endif
              @check('visitas')
                <li class="nav-item nav-item-submenu  {{ (request()->is('visitas*') OR request()->is('oficinas*') OR request()->is('empleados*') OR  request()->is('motivos*') ) ? 'nav-item-expanded nav-item-open' : '' }} ">
                  <a href="#" class="nav-link"><i class="icon-stack"></i> <span>Visitas</span></a>
                  <ul class="nav nav-group-sub" data-submenu-title="visitas">
                    <li class="nav-item"><a href="{{ url('visitas') }}" class="nav-link {{ (request()->is('visitas')) ? 'active' : '' }}">Visitas</a></li>
                    <li class="nav-item"><a href="{{ url('visitas/create') }}" class="nav-link {{ (request()->is('visitas/create')) ? 'active' : '' }}">Registrar Visitas</a></li>
                    <li class="nav-item"><a href="{{ url('oficinas') }}" class="nav-link {{ (request()->is('oficinas')) ? 'active' : '' }}">Oficinas</a></li>
                    <li class="nav-item"><a href="{{ url('empleados') }}" class="nav-link {{ (request()->is('empleados')) ? 'active' : '' }}">Empleados</a></li>
                    <li class="nav-item"><a href="{{ url('motivos') }}" class="nav-link {{ (request()->is('motivos')) ? 'active' : '' }}">Motivos</a></li>
                    <li class="nav-item"><a href="{{ url('sedes') }}" class="nav-link {{ (request()->is('sedes')) ? 'active' : '' }}">Sedes</a></li>
                  </ul>
                </li>
              @endcheck
              @foreach ($menus as $key => $item)
                  @if ($item['parent'] != 0)
                      @break
                  @endif
                  @include('layouts.menu-items.items', ['item' => $item])
              @endforeach
              <!-- /main -->
            </ul>
          </div>
          <!-- /main navigation -->
        </div>
        <!-- /sidebar content -->
      </div>
      <!-- /main sidebar -->
    @endif