passwordService = $passwordService; $this->repository = $repository; } /** * Render the database listing for a server. * * @param \Illuminate\Http\Request $request * @return \Illuminate\View\View */ public function index(Request $request): View { $server = $request->attributes->get('server'); $this->injectJavascript(); return view('server.databases.index', [ 'databases' => $this->repository->getDatabasesForServer($server->id), ]); } /** * Handle a request to update the password for a specific database. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\JsonResponse * * @throws \Pterodactyl\Exceptions\Model\DataValidationException * @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException */ public function update(Request $request): JsonResponse { $password = str_random(20); $this->passwordService->handle($request->attributes->get('database'), $password); return response()->json(['password' => $password]); } }