*/ protected function getHeaderActions(): array { $actions = [ Action::make('refresh') ->label('Refresh') ->icon('heroicon-o-arrow-path') ->color('gray') ->url(fn (): string => url()->current()), ]; if (! isset($this->run)) { return $actions; } $tenant = $this->run->tenant; $user = auth()->user(); if (! $tenant instanceof Tenant || ! $user instanceof User) { return $actions; } if (! app(CapabilityResolver::class)->isMember($user, $tenant)) { return $actions; } $actions[] = Action::make('admin_details') ->label('Admin details') ->icon('heroicon-o-arrow-top-right-on-square') ->color('gray') ->url(fn (): string => route('filament.admin.resources.operations.view', [ 'tenant' => (int) $tenant->getKey(), 'record' => (int) $this->run->getKey(), ])); return $actions; } public function mount(OperationRun $run): void { $user = auth()->user(); if (! $user instanceof User) { abort(403); } $workspaceId = (int) ($run->workspace_id ?? 0); if ($workspaceId <= 0) { abort(404); } $isMember = WorkspaceMembership::query() ->where('workspace_id', $workspaceId) ->where('user_id', (int) $user->getKey()) ->exists(); if (! $isMember) { abort(404); } $this->run = $run->loadMissing(['workspace', 'tenant', 'user']); } }