{{-- Segment tabs of one admin group (DESIGN.md "Admin hub"; #2957 slice 11, card #3097). The group map, the Swedish labels and the visibility check per page live in App\Support\AdminHub, shared with the hub (admin/index), so a tab only shows when the viewer may open that page. Usage on every admin page, under the page head: @include('partials.nh-admin-back') above the page head (quiet "Admin" link to the hub) Groups: kunder, innehall, forsaljning, drift. The current tab is the page whose route name equals 'current' (default: the current route). Create, edit and show pages pass their list route: Nothing is rendered when the viewer may open none of the group's pages. --}} @php $nhAdminGroup = \App\Support\AdminHub::group(Auth::user(), $group); $nhAdminCurrent = $current ?? Route::currentRouteName(); $nhAdminTabs = array_map(fn (array $page) => [ 'label' => $page['label'], 'href' => $page['href'], 'current' => $page['route'] === $nhAdminCurrent, ], $nhAdminGroup['pages']); @endphp @if ($nhAdminTabs !== []) @endif