user()?->can('viewAny', SshKey::class) ?? false; } public function getWidgets(): array { return [ [Widgets\SshKeysList::class], ]; } protected function getHeaderActions(): array { return [ CreateAction::make('add') ->label('Add Key') ->icon('heroicon-o-plus') ->modalHeading('Add a new Key') ->modalSubmitActionLabel('Add') ->createAnother(false) ->form([ TextInput::make('name') ->label('Name') ->rules(CreateSshKey::rules()['name']), Textarea::make('public_key') ->label('Public Key') ->rules(CreateSshKey::rules()['public_key']), ]) ->authorize('create', SshKey::class) ->modalWidth(MaxWidth::Large) ->using(function (array $data) { app(CreateSshKey::class)->create(auth()->user(), $data); $this->dispatch('$refresh'); }), ]; } }