@php // config에서 CS 탭 가져와서, 기존 subpage-sidenav가 기대하는 형식(label,url,key)으로 변환 $items = collect(config('web.cs_tabs', [])) ->map(function ($t) { return [ 'label' => $t['label'] ?? '', 'url' => isset($t['route']) ? route($t['route']) : '#', 'key' => $t['key'] ?? null, ]; }) ->values() ->all(); // activeKey는 페이지에서 넘기거나, 없으면 현재 route로 자동 판별도 가능 $activeKey = $activeKey ?? null; if (!$activeKey) { // route 기반 자동 active (routeIs가 동작하려면 routes에 name이 있어야 함) foreach (config('web.cs_tabs', []) as $t) { if (!empty($t['route']) && request()->routeIs($t['route'])) { $activeKey = $t['key'] ?? null; break; } } } @endphp {{-- Mobile Tabs --}}
@include('web.partials.subpage-sidenav', [ 'items' => $items, 'active' => $activeKey, 'mode' => 'tabs' ])
{{-- Desktop Side --}}