@foreach($module['sections'] as $section) @php $isOverview = $section['key'] === 'overview'; $url = $isOverview ? route($section['items'][0]['route']) : route('accounting.sections.show', $section['key']); $isItemActive = fn (array $item): bool => $item['route'] !== null && request()->routeIs(...($item['active'] ?? [$item['route']])); $active = $isOverview ? request()->routeIs('accounting.dashboard') : (request()->route('section') === $section['key'] || collect($section['items'])->contains($isItemActive)); $pending = collect($section['items'])->every(fn (array $item): bool => $item['route'] === null); @endphp
{{ __($section['label']) }} @unless($isOverview)
    @foreach($section['items'] as $item)
  • @if($item['route'] === null) {{ __($item['label']) }} {{ __('Coming soon') }} @else {{ __($item['label']) }} @endif
  • @endforeach
@endunless
@endforeach