authorize('viewAny', [ServerLog::class, $this->server]); } public function getWidgets(): array { return [ [LogsList::class, ['server' => $this->server, 'remote' => true]], ]; } protected function getHeaderActions(): array { return [ Action::make('create') ->icon('heroicon-o-plus') ->modalWidth(MaxWidth::Large) ->authorize(fn () => auth()->user()?->can('create', [ServerLog::class, $this->server])) ->form([ TextInput::make('path') ->helperText('The full path of the log file on the server') ->rules(fn (callable $get) => CreateServerLog::rules()['path']), ]) ->modalSubmitActionLabel('Create') ->action(function (array $data): void { app(CreateServerLog::class)->create($this->server, $data); $this->dispatch('$refresh'); }), ]; } }