daemonServerRepository = $daemonServerRepository; $this->connection = $connection; $this->repository = $repository; } /** * Reinstall a server on the remote daemon. * * @param \Pterodactyl\Models\Server $server * @return \Pterodactyl\Models\Server * * @throws \Throwable */ public function reinstall(Server $server) { return $this->connection->transaction(function () use ($server) { $updated = $this->repository->update($server->id, [ 'installed' => Server::STATUS_INSTALLING, ], true, true); $this->daemonServerRepository->setServer($server)->reinstall(); return $updated; }); } }