@props(['menus', 'section' => null]) @php // 섹션 레이블 $sectionLabels = [ 'main' => null, 'tools' => '개발 도구', 'labs' => 'R&D Labs', ]; $sectionLabel = $section ? ($sectionLabels[$section] ?? null) : null; @endphp @if($menus->isNotEmpty()) {{-- 섹션 레이블 (tools, labs) --}} @if($sectionLabel)
  • {{ $sectionLabel }}
  • @endif @foreach($menus as $menu) @if($menu->menuChildren && $menu->menuChildren->isNotEmpty()) {{-- 자식 메뉴가 있으면 그룹으로 렌더링 --}} @else {{-- 자식 없으면 단일 아이템 --}} @endif @endforeach @endif