where('id', $egg) ->firstOrFail(); $copy = Egg::query() ->whereNull('copy_script_from') ->where('nest_id', $egg->nest_id) ->whereNot('id', $egg->id) ->firstOrFail(); $rely = Egg::query()->where('copy_script_from', $egg->id)->firstOrFail(); return view('admin.eggs.scripts', [ 'copyFromOptions' => $copy, 'relyOnScript' => $rely, 'egg' => $egg, ]); } /** * Handle a request to update the installation script for an Egg. * * @throws \App\Exceptions\Model\DataValidationException */ public function update(EggScriptFormRequest $request, Egg $egg): RedirectResponse { $this->installScriptService->handle($egg, $request->normalize()); $this->alert->success(trans('admin/eggs.notices.script_updated'))->flash(); return redirect()->route('admin.eggs.scripts', $egg); } }