menu.blade.php 1.9 KB

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