@foreach ($menuItems ?? [] as $item) @php $hasChildren = !empty($item['children']); @endphp @endforeach