menu.blade.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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 menu-open' : '' }} nav-item has-treeview {{ $builder->isActive($item) ? 'menu-open' : '' }}">
  19. <a href="#" class="nav-link {{ $horizontal ? 'dropdown-toggle' : '' }}" {{ $horizontal ? 'data-toggle="dropdown"' : '' }}>
  20. {!! str_repeat('&nbsp;', $depth) !!}<i class="fa fa-fw {{ $item['icon'] ?: 'feather icon-circle' }}"></i>
  21. <p>
  22. {{ $builder->translate($item['title']) }}
  23. @if(! $horizontal)
  24. <i class="right fa fa-angle-left"></i>
  25. @endif
  26. </p>
  27. </a>
  28. <ul class="nav nav-treeview {{ $horizontal ? 'dropdown-menu' : '' }}">
  29. @foreach($item['children'] as $item)
  30. @php
  31. $item['depth'] = $depth + 1;
  32. @endphp
  33. @include('admin::partials.menu', $item)
  34. @endforeach
  35. </ul>
  36. </li>
  37. @endif
  38. @endif