namespace Pterodactyl\Http\Controllers\Admin\Arix;
use Illuminate\View\View;
use Illuminate\Support\Facades\Http as AASupport;
use Prologue\Alerts\AlertsMessageBag;
use Illuminate\View\Factory as ViewFactory;
use Pterodactyl\Http\Controllers\Controller;
use Pterodactyl\Http\Requests\Admin\Arix\ArixRequest;
use Pterodactyl\Contracts\Repository\SettingsRepositoryInterface;
class ArixController extends Controller {
public function __construct(private AlertsMessageBag $alert, private SettingsRepositoryInterface $settings, private ViewFactory $view) {
}
public function index() : View {
return $this->view->make("admin.arix.index", ["logo" => $this->settings->get("settings::arix:logo", "/arix/Arix.png"), "logoLight" => $this->settings->get("settings::arix:logoLight", "/arix/Arix.png"), "fullLogo" => $this->settings->get("settings::arix:fullLogo", false), "logoHeight" => $this->settings->get("settings::arix:logoHeight", "32"), "discord" => $this->settings->get("settings::arix:discord", "728112197300"), "support" => $this->settings->get("settings::arix:support", "https://discord.gg/geCjrRbAwC")]);
}
public function store(ArixRequest $request) {
goto mbYKT;
BbL9z: throw new \Exception("Something went wrong");
goto t0nCJ;
tPm2U: $this->alert->warning("Something went wrong.")->flash();
goto BbL9z;
mMj09: TimD3: goto tPm2U;
z5pFu: return redirect()->route("admin.arix");
goto bI3Iw;
uq3xV: $respond = "success";
goto q75RH;
t0nCJ: GGv2l: goto z5pFu;
TLcFP: if (!$responseData[$respond]) {
goto TimD3;
}
goto ihcx2;
PttRC: dBQkG: goto dyGQ2;
dyGQ2: $this->alert->success("Theme settings have been updated successfully.")->flash();
goto eZLZv;
eZLZv: goto GGv2l;
goto mMj09;
q75RH: $response = AASupport::asForm()->post($endpoint, ["license" => config("arixTheme.license")]);
goto MF83H;
ihcx2: foreach ($request->normalize() as $key => $value) {
$this->settings->set("settings::" . $key, $value);
uJsFs:
}
goto PttRC;
MF83H: $responseData = $response->json();
goto TLcFP;
mbYKT: $endpoint = "https://arix.gg/license/arix-theme";
goto uq3xV;
bI3Iw:
}
}
© 2023 Quttera Ltd. All rights reserved.