[ [ 'code' => 'InvalidCopyFromException', 'status' => '400', 'detail' => 'The selected egg cannot be used as an install script source.', ], ], ]; /** * Show egg install script. */ #[Endpoint('Get egg install script', 'Returns an egg with its install script block.')] #[ResponseFromResource(EggResource::class, Egg::class, description: 'Egg install script returned.', resourceKey: 'egg')] public function show(GetEggScriptRequest $request, Egg $egg): EggResource { return EggResource::make($egg); } /** * Update egg install script. */ #[Endpoint('Update egg install script', 'Updates the install script configuration for an egg.')] #[ResponseFromResource(EggResource::class, Egg::class, description: 'Egg install script updated.', resourceKey: 'egg')] #[ScribeResponse(self::INVALID_COPY_FROM_ERROR, status: 400, description: 'The selected copy source is invalid.')] public function update(UpdateEggScriptRequest $request, UpdatesEggInstallScripts $scripts, Egg $egg): EggResource { $egg = $scripts->update($egg, $request->actionInput()); Activity::event('admin:egg.scripts') ->subject($egg) ->property('name', $egg->name) ->log(); return EggResource::make($egg); } }