menu.blade.php 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. @php
  2. $depth = $item['depth'] ?? 0;
  3. $horizontal = config('admin.layout.horizontal_menu');
  4. @endphp
  5. @if($builder->visible($item))
  6. @if(empty($item['children']))
  7. <li class="nav-item">
  8. <a @if(mb_strpos($item['uri'], '://') !== false) target="_blank" @endif
  9. href="{{ $builder->getUrl($item['uri']) }}"
  10. class="nav-link {!! $builder->isActive($item) ? 'active' : '' !!}">
  11. {!! str_repeat('&nbsp;', $depth) !!}<i class="fa fa-fw {{ $item['icon'] ?: 'feather icon-circle' }}"></i>
  12. <p>
  13. {{ $builder->translate($item['title']) }}
  14. </p>
  15. </a>
  16. </li>
  17. @else
  18. <li class="{{ $horizontal ? 'dropdown' : 'has-treeview' }} {{ $depth > 0 ? 'dropdown-submenu' : '' }} nav-item {{ $builder->isActive($item) ? 'menu-open' : '' }}">
  19. <a href="#"
  20. class="nav-link {{ $builder->isActive($item) ? ($horizontal ? 'active' : '') : '' }}
  21. {{ $horizontal ? 'dropdown-toggle' : '' }}">
  22. {!! str_repeat('&nbsp;', $depth) !!}<i class="fa fa-fw {{ $item['icon'] ?: 'feather icon-circle' }}"></i>
  23. <p>
  24. {{ $builder->translate($item['title']) }}
  25. @if(! $horizontal)
  26. <i class="right fa fa-angle-left"></i>
  27. @endif
  28. </p>
  29. </a>
  30. <ul class="nav {{ $horizontal ? 'dropdown-menu' : 'nav-treeview' }}">
  31. @foreach($item['children'] as $item)
  32. @php
  33. $item['depth'] = $depth + 1;
  34. @endphp
  35. @include('admin::partials.menu', ['item' => $item])
  36. @endforeach
  37. </ul>
  38. </li>
  39. @endif
  40. @endif