@forelse ($items as $item )
@php
$hasPermission = empty($item['permission']) || auth()->user()->can($item['permission']);
$passesCondition = !isset($item['condition']) || (isset($item['condition']) && $item['condition']());
@endphp
@if ($hasPermission && $passesCondition)
@if (isset($item['divider']) && $item['divider'])
@endif
@if (!isset($item['divider']))
@if (isset($item['icon']) && !empty($item['icon']))
@else
![{{ $item['name'] }}]({{ $item['image'] }})
@endif
@if (!empty($item['badge']))
{{$item['badge']}}
@endif
@if (!empty($item['children']))
@foreach ($item['children'] as $child)
@if (empty($child['permission']) || auth()->user()->can($child['permission']))
-
{{ $child['name'] }}
@endif
@endforeach
@endif
@endif
@endif
@empty
@endforelse
@push('scripts')
@endpush