bp->latestVersion(); if(str_starts_with($latestVersion, "Error: ")) { $latestVersion = $this->bp->version(); } return $this->view->make( 'admin.extensions.blueprint.index', [ 'version' => $this->version, 'bp' => $this->bp, 'blueprint' => $this->blueprint, 'telemetry' => $this->telemetry, 'versionLatest' => $latestVersion, 'root' => "/admin/extensions/blueprint", ] ); } /** * @throws \Pterodactyl\Exceptions\Model\DataValidationException * @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException */ public function update(BlueprintAdminFormRequest $request): RedirectResponse { foreach ($request->normalize() as $key => $value) { $this->settings->set('blueprint::' . $key, $value); } // Confirm that the database value changes have been applied. $this->blueprint->notify("Your changes have been saved."); // Redirect back to the page the user was on. return redirect()->route('admin.extensions.blueprint.index'); } } class BlueprintAdminFormRequest extends AdminFormRequest { // Form validation for settings on the Blueprint admin page. // This is included in the controller directly as that // simplifies my work. public function rules(): array { return [ 'placeholder' => 'string', 'developer' => 'string', 'telemetry' => 'string', ]; } public function attributes(): array { return [ 'placeholder' => 'Placeholder Value', 'developer' => 'Developer Mode', 'telemetry' => 'Telemetry', ]; } }