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 \App\Exceptions\Model\DataValidationException */ public function store(InstallationDataRequest $request, Server $server): JsonResponse { $status = null; $successful = $request->boolean('successful'); // Make sure the type of failure is accurate if (!$successful) { $status = $request->boolean('reinstall') ? ServerState::ReinstallFailed : ServerState::InstallFailed; } // Keep the server suspended if it's already suspended if ($server->status === ServerState::Suspended) { $status = ServerState::Suspended; } $previouslyInstalledAt = $server->installed_at; $server->status = $status; $server->installed_at = now(); $server->save(); $isInitialInstall = is_null($previouslyInstalledAt); event(new ServerInstalled($server, $successful, $isInitialInstall)); return new JsonResponse([], Response::HTTP_NO_CONTENT); } }