<?php  
    $logo = \App\Models\Utility::getLogo(); 
?>
<!-- Main Sidebar Container -->
 <aside class="main-sidebar sidebar-dark-primary elevation-4">
    <!-- Brand Logo -->
    <a href="#" class="brand-link">
      
      <img src="<?php echo e(asset($logo)); ?>" alt="Suhu Logo" class="brand-image img-circle elevation-3" style="opacity: .8">
      <span class="brand-text font-weight-light"><?php echo e(config('app.name', 'Laravel')); ?></span>
    </a>

    <!-- Sidebar -->
    <div class="sidebar">
      
      <!-- SidebarSearch Form -->
      <div class="form-inline">
        <div class="input-group" data-widget="sidebar-search">
          <input class="form-control form-control-sidebar" type="search" placeholder="Search" aria-label="Search">
          <div class="input-group-append">
            <button class="btn btn-sidebar">
              <i class="fas fa-search fa-fw"></i>
            </button>
          </div>
        </div>
      </div>

      <!-- Sidebar Menu -->
      <nav class="mt-2">
        <ul class="nav nav-pills nav-sidebar flex-column" data-widget="treeview" role="menu" data-accordion="false">
          <!-- Add icons to the links using the .nav-icon class
               with font-awesome or any other icon font library -->
               <?php 
               $menus = listMenu();     
               ?>
               <?php $__currentLoopData = $menus; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $menu): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
               
                 <?php
                   $permission = $menu->permission->name;
                   
                   $arrMenuRequest = explode('~',$menu->request);
                   $strMenuRequest = "";
                   if(count($arrMenuRequest)>1)
                   {
                     foreach($arrMenuRequest as $arrMenu)
                     {
                       $strMenuRequest .= Request::routeIs($arrMenu)." || ";
                     }
                     $strMenuRequest = rtrim($strMenuRequest," || ");
                   }
                   else 
                   {
                     $strMenuRequest .= Request::routeIs($menu->request);
                   } 
                 ?>
                 <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check($permission)): ?>
                   <li class="nav-item <?php echo e(($strMenuRequest) ? 'menu-open' : ''); ?>" >
                     <a href="<?php echo e(($menu->route == '#' ) ?'#':route($menu->route)); ?>" class="nav-link <?php echo e(($strMenuRequest) ? 'active' : ''); ?>">
                       <i class="nav-icon <?php echo e($menu->icon); ?>"></i>
                       <p>
                         <?php echo e(ucfirst($menu->menu_name)); ?>

                        <?php if(count($menu->childs)): ?>
                         <i class="right fas fa-angle-left"></i>
                         <?php endif; ?>
                       </p>
                     </a>
                                    
                         <?php if(count($menu->childs)): ?>
                           <?php echo $__env->make('pages.menu.sub-menu',['childs' => $menu->childs], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
                         <?php endif; ?>                  
                     
                   </li>
                 <?php endif; ?>
               <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>    
        </ul>
      </nav>
      <!-- /.sidebar-menu -->
    </div>
    <!-- /.sidebar -->
  </aside><?php /**PATH C:\xampp\htdocs\extranet\resources\views/includes/sidebar.blade.php ENDPATH**/ ?>