repository = $repository; $this->reinstallServerService = $reinstallServerService; } /** * Renames a server. * * @param \Pterodactyl\Http\Requests\Api\Client\Servers\Settings\RenameServerRequest $request * @param \Pterodactyl\Models\Server $server * @return \Illuminate\Http\JsonResponse * * @throws \Pterodactyl\Exceptions\Model\DataValidationException * @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException */ public function rename(RenameServerRequest $request, Server $server) { $this->repository->update($server->id, [ 'name' => $request->input('name'), ]); return JsonResponse::create([], Response::HTTP_NO_CONTENT); } /** * Reinstalls the server on the daemon. * * @param \Pterodactyl\Http\Requests\Api\Client\Servers\Settings\ReinstallServerRequest $request * @param \Pterodactyl\Models\Server $server * @return \Illuminate\Http\JsonResponse * * @throws \Throwable */ public function reinstall(ReinstallServerRequest $request, Server $server) { $this->reinstallServerService->reinstall($server); return JsonResponse::create([], Response::HTTP_ACCEPTED); } }