menu.blade.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. @php
  2. $active = $builder->isActive($item);
  3. $depth = $item['depth'] ?? 0;
  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 href="{{ $builder->getUrl($item['uri']) }}" class="nav-link {!! $builder->isActive($item) ? 'active' : '' !!}">
  9. {!! str_repeat('&nbsp;', $depth) !!}<i class="fa fa-fw {{ $item['icon'] ?: 'feather icon-circle' }}"></i>
  10. <p>
  11. {{ $builder->translate($item['title']) }}
  12. </p>
  13. </a>
  14. </li>
  15. @else
  16. @php
  17. $active = $builder->isActive($item);
  18. @endphp
  19. <li class="nav-item has-treeview {{ $active ? 'menu-open' : '' }}">
  20. <a href="#" class="nav-link">
  21. {!! str_repeat('&nbsp;', $depth) !!}<i class="fa fa-fw {{ $item['icon'] ?: 'feather icon-circle' }}"></i>
  22. <p>
  23. {{ $builder->translate($item['title']) }}
  24. <i class="right fa fa-angle-left"></i>
  25. </p>
  26. </a>
  27. <ul class="nav nav-treeview">
  28. @foreach($item['children'] as $item)
  29. @php
  30. $item['depth'] = $depth + 1;
  31. @endphp
  32. @include('admin::partials.menu', $item)
  33. @endforeach
  34. </ul>
  35. </li>
  36. @endif
  37. @endif