@php(
$ribbon = "inline-block relative h-7 leading-7 -ml-4 -mt-4 pl-2 pr-4 text-center
bg-primary-700 text-white text-xs font-sansf tracking-widest min-w-10 box-border
after:absolute after:content-[''] after:w-0 after:h-0 after:z-10 after:-top-0 after:right-0
after:border-y-[14px] after:border-r-[7px] after:border-l-0
after:border-y-transparent after:border-r-white after:border-l-transparent"
)
{{-- 権限フィルタリング済みメニューからカテゴリボタンを動的生成 --}}
@foreach($dashboardFilteredMenus as $categoryKey => $category)
@endforeach
{{-- ログインユーザーのロール権限でフィルタリングされたメニューを取得 --}}
@php($filteredMenus = App\Services\Logic\Assist::getFilteredMenus())
@php($viewMenus = App\Services\Logic\Assist::canViewMenus())
@php($viewMenuIds = is_array($viewMenus) ? collect([]) : $viewMenus->pluck('menu_id'))
{{-- config/display_menus.phpから自動生成(権限フィルタリング済み) --}}
@foreach($filteredMenus as $categoryKey => $category)
@if($categoryKey !== 'reports') {{-- レポートは特別処理なので除外 --}}
{{ $category['label'] }}
@foreach($category['sections'] as $sectionKey => $section)
first) class="" @endif>
{{ $section['label'] }}
@endforeach
@endif
@endforeach
{{-- 検索・レポートは特別処理(reportsカテゴリがフィルタリング済みメニューに含まれている場合のみ表示) --}}
@if(isset($filteredMenus['reports']))
参照
@php($reportsByCategory = collect(config('report'))->filter(fn($r) => isset($r['category']))->groupBy('category'))
@foreach($reportsByCategory as $category => $reports)
{{ $category }}
@foreach($reports as $report)
@php($url = (!isset($report['id']) && isset($report['note']) && isset($report['route'])) ? route($report['route']) : route('reports.index', ['report'=>$report['id']]))
@php($path = trim(parse_url($url, PHP_URL_PATH), '/'))
@php($menuId = App\Services\Logic\Assist::routeToMenuId($path))
@if($viewMenuIds->isEmpty() || $viewMenuIds->containsStrict($menuId))
@php($href = (!isset($report['id']) && isset($report['note']) && isset($report['route'])) ? route($report['route']) : route('reports.index', ['report'=>$report['id']]))
@php($openNewWindow = $report['open_in_new_window'] ?? false)
{{$report['name']}}
@if($openNewWindow)@endif
@endif
@endforeach
@endforeach
@endif