{{-- Phase 11 — boxed sidebar menu with colourful icons and collapsible groups. $items: list of ['sec' => 'Heading'] section title ['label', 'icon', 'color', 'url', 'active', 'badge'?, 'lock'?, 'blank'?] link ['label', 'icon', 'color', 'children' => [links…]] group (opens when a child is active) Items with 'show' => false are skipped; a group without visible children is skipped. --}} @php $visible = fn ($i) => ($i['show'] ?? true) !== false; @endphp @foreach ($items as $n => $item) @continue(! $visible($item)) @if (isset($item['sec']))
{{ $item['sec'] }}
@elseif (! empty($item['children'])) @php $kids = array_values(array_filter($item['children'], $visible)); $open = collect($kids)->contains(fn ($k) => ! empty($k['active'])); $gid = 'pmg'.$n.'_'.substr(md5($item['label']), 0, 6); @endphp @if ($kids)
$open])> @foreach ($kids as $k) ! empty($k['active'])]) @if (! empty($k['blank'])) target="_blank" @endif title="{{ $k['label'] }}"> {{ $k['label'] }} @if (! empty($k['badge'])){{ $k['badge'] }}@endif @if (! empty($k['lock']))@endif @endforeach
@endif @else ! empty($item['active'])]) @if (! empty($item['blank'])) target="_blank" @endif title="{{ $item['label'] }}"> {{ $item['label'] }} @if (! empty($item['badge'])){{ $item['badge'] }}@endif @if (! empty($item['lock']))@endif @endif @endforeach