user()?->can('update', static::getServerFromRoute()) ?? false; } public function getWidgets(): array { return [ [ ServerDetails::class, ['server' => $this->server], ], [ UpdateServerInfo::class, ['server' => $this->server], ], ]; } protected function getHeaderActions(): array { return [ DeleteAction::make() ->icon('heroicon-o-trash') ->record($this->server) ->modalHeading('Delete Server') ->modalDescription('Once your server is deleted, all of its resources and data will be permanently deleted and can\'t be restored'), Action::make('reboot') ->color('gray') ->icon('heroicon-o-arrow-path') ->label('Reboot') ->requiresConfirmation() ->action(function () { app(RebootServer::class)->reboot($this->server); $this->dispatch('$refresh'); Notification::make() ->info() ->title('Server is being rebooted') ->send(); }), ]; } protected function getServer(): ?Server { return $this->server; } }