repository = $repository; } /** * @param \Illuminate\Http\Request $request * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View * @throws \Illuminate\Auth\Access\AuthorizationException */ public function index(Request $request) { $this->authorize('view-name', $request->attributes->get('server')); $this->setRequest($request)->injectJavascript(); return view('server.settings.name'); } /** * Update the stored name for a specific server. * * @param \Pterodactyl\Http\Requests\Server\Settings\ChangeServerNameRequest $request * @return \Illuminate\Http\RedirectResponse * * @throws \Pterodactyl\Exceptions\Model\DataValidationException * @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException */ public function update(ChangeServerNameRequest $request): RedirectResponse { $this->repository->update($request->getServer()->id, $request->validated()); return redirect()->route('server.settings.name', $request->getServer()->uuidShort); } }