daemonServerRepository = $daemonServerRepository; $this->connection = $connection; } /** * Reinstall a server on the remote daemon. * * @param \Pterodactyl\Models\Server $server * @return \Pterodactyl\Models\Server * * @throws \Throwable */ public function handle(Server $server) { return $this->connection->transaction(function () use ($server) { $server->fill(['status' => Server::STATUS_INSTALLING])->save(); $this->daemonServerRepository->setServer($server)->reinstall(); return $server->refresh(); }); } }