@php
// $viewMenus は親から渡されるmenu_idのコレクション
$viewMenuIds = $viewMenus ?? collect([]);
@endphp
{{-- レポート --}}
{{-- 検索 --}}
@foreach(config('report') as $report)
@if(isset($report['type']) && $report['type']=='search')
@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))
@if(!isset($report['id']) && isset($report['note']) && isset($report['route']))
@else
@endif
@endif
@endif
@endforeach
{{-- レポート --}}
@foreach(config('report') as $report)
@if(isset($report['type']) && $report['type']=='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))
@if(!isset($report['id']) && isset($report['note']) && isset($report['route']))
@else
@endif
@endif
@endif
@endforeach