egg; return new JsonResponse([ 'container_image' => $egg->copy_script_container, 'entrypoint' => $egg->copy_script_entry, 'script' => $egg->copy_script_install, ]); } /** * Updates the installation state of a server. * * @throws ContainerExceptionInterface * @throws NotFoundExceptionInterface */ public function store(InstallationDataRequest $request, string $uuid): JsonResponse { $server = Server::findOrFailByUuid($uuid); $status = $request->boolean('successful') ? null : Server::STATUS_INSTALL_FAILED; if ($server->status === Server::STATUS_SUSPENDED) { $status = Server::STATUS_SUSPENDED; } $previouslyInstalledAt = $server->installed_at; $server->status = $status; $server->installed_at = now(); $server->save(); // If the server successfully installed, fire installed event. // This logic allows individually disabling install and reinstall notifications separately. $isInitialInstall = is_null($previouslyInstalledAt); if ($isInitialInstall && config()->get('pterodactyl.email.send_install_notification', true)) { $this->eventDispatcher->dispatch(new ServerInstalled($server)); } elseif (!$isInitialInstall && config()->get('pterodactyl.email.send_reinstall_notification', true)) { $this->eventDispatcher->dispatch(new ServerInstalled($server)); } return new JsonResponse([], Response::HTTP_NO_CONTENT); } }