@php // Content and script sections are rendered as separate Blade includes, // so variables created inside the content partial are not available here. $scriptViewerRole = (string) (Auth::user()->role ?? $dashboardDefaultRole); $scriptHasDashboardTabs = \App\Support\WorkflowPermission::canUseAdminPermission( $scriptViewerRole, \App\Support\WorkflowPermission::ADMIN_PERMISSION_REQUEST_DOCUMENT ); $scriptActiveDashboardTab = $scriptHasDashboardTabs && request()->query('view') === 'requests' ? 'requests' : 'work'; $scriptStatusFilterMap = $scriptActiveDashboardTab === 'work' ? [ 'Need Your Decision' => ['Need Your Decision'], 'Approved' => ['Approved'], 'Sent Back by You' => ['Sent Back by You'], 'Completed' => ['Completed'], 'Rejected' => ['Rejected'], ] : [ 'In Progress' => ['In Progress'], 'Sent Back to Me' => ['Sent Back to You'], 'Sent Back by My Organization' => ['Sent Back by My Organization'], 'Completed' => ['Completed'], 'Rejected' => ['Rejected'], ]; @endphp