@php if (auth()->user()->user_type == \App\Models\User::USER_TYPE_ACCOUNTING) { $items = menu('accounting', '_json'); } else { $items = menu('admin', '_json'); } if (Voyager::translatable($items)) { $items = $items->load('translations'); } @endphp @foreach ($items as $item) @php $originalItem = $item; if (Voyager::translatable($item)) { $item = $item->translate($options->locale); } $isActive = null; $listItemClass = null; $linkAttributes = null; $styles = null; $icon = null; $caret = null; // Background Color or Color if (isset($options->color) && $options->color == true) { $styles = 'color:' . $item->color; } if (isset($options->background) && $options->background == true) { $styles = 'background-color:' . $item->color; } // With Children Attributes if (!$originalItem->children->isEmpty()) { $linkAttributes = 'class="dropdown-toggle" data-toggle="dropdown"'; $caret = ''; if (url($item->link()) == url()->current()) { $listItemClass = 'dropdown active'; } else { $listItemClass = 'dropdown'; } } // Check if link is current if (url($item->link()) == url()->current()) { $isActive = 'active'; } // Set Icon if (isset($options->icon) && $options->icon == true) { $icon = ''; } @endphp {{--
  • children->count()) data-toggle="collapse" data-target="#collapseExample{{ $item->id }}" aria-expanded="false" aria-controls="collapseExample{{ $item->id }}" @endif > children->count()) href="#" @else href="{{ $item->link(true) }}" @endif @if ($item->children->count()) data-toggle="sub-menu" @endif >

    {{ $item->title }} @if ($item->children->count()) @endif

    @if ($item->children->count())
      @php $children = $item->children; @endphp --}}{{-- --}}{{-- @foreach ($item->children as $subItem)
    • {{ $subItem->title }}
    • @if (!$loop->last)
    • @endif @endforeach
    @endif
  • --}} @if (($item->url != '' && $item->url != '#') || ($item->route != null && $item->route != '') || $item->children->count())
  • children->count()) data-toggle="collapse" data-target="#collapseExample{{ $item->id }}" aria-expanded="false" aria-controls="collapseExample{{ $item->id }}" @endif> children->count()) href="#" @else href="{{ $item->link(true) }}" @endif @if ($item->children->count()) data-toggle="sub-menu" @endif>

    {{ $item->title }} @if ($item->children->count()) @endif

    @if ($item->children->count())
      @php $children = $item->children; @endphp {{-- --}} @foreach ($item->children as $subItem)
    • {{-- {{ $subItem->title }} --}}

      {{ $subItem->title }}

    • @if (!$loop->last)
    • @endif @endforeach
    @endif
  • @endif @endforeach