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\ArixSocialRequest;
use Pterodactyl\Contracts\Repository\SettingsRepositoryInterface;
class ArixSocialController extends Controller {
public function __construct(private AlertsMessageBag $alert, private SettingsRepositoryInterface $settings, private ViewFactory $view) {
}
public function index() : View {
return $this->view->make("admin.arix.social", ["socials" => json_decode($this->settings->get("settings::arix:socials", "[]"), true), "socialButtons" => $this->settings->get("settings::arix:socialButtons", false), "discordBox" => $this->settings->get("settings::arix:discordBox", true)]);
}
public function store(ArixSocialRequest $request) {
goto kpLFL;
GxJAV: $this->alert->success("Theme settings have been updated successfully.")->flash();
goto L8LgD;
pERhx: $this->alert->warning("Something went wrong.")->flash();
goto rK4tU;
xRdWz: $responseData = $response->json();
goto fyePQ;
cQDKi: foreach ($request->normalize() as $key => $value) {
goto B06fi;
UfCUh: if (!empty($value)) {
goto RtocO;
}
goto IhCKX;
EPl3h: if (!($value === '' || $value === null)) {
goto vCuZ8;
}
goto t_0Eb;
aXPjU: vCuZ8: goto oPeqx;
VbmMb: $value = json_encode($value);
goto pFi5S;
B06fi: if (is_array($value)) {
goto u7JOJ;
}
goto EPl3h;
soZW4: $this->settings->set("settings::" . $key, $value);
goto KEsrx;
XwbTE: RtocO: goto VbmMb;
t_0Eb: goto iLa6f;
goto aXPjU;
KEsrx: iLa6f: goto lweU1;
pFi5S: Sgbd8: goto soZW4;
ZuxfN: u7JOJ: goto FBi3o;
FBi3o: $value = array_filter($value, fn($item) => $item !== '' && $item !== null);
goto UfCUh;
IhCKX: goto iLa6f;
goto XwbTE;
oPeqx: goto Sgbd8;
goto ZuxfN;
lweU1:
}
goto Nzl2g;
IUzk9: $response = AASupport::asForm()->post($endpoint, ["license" => config("arixTheme.license")]);
goto xRdWz;
rK4tU: throw new \Exception("Something went wrong");
goto vVcMF;
fyePQ: if (!$responseData[$respond]) {
goto Tz3FS;
}
goto cQDKi;
vVcMF: tf6fM: goto r85Ch;
L8LgD: goto tf6fM;
goto wCDrH;
kpLFL: $endpoint = "https://arix.gg/license/arix-theme";
goto NWtT2;
wCDrH: Tz3FS: goto pERhx;
NWtT2: $respond = "success";
goto IUzk9;
r85Ch: return redirect()->route("admin.arix.social");
goto KbGmw;
Nzl2g: tFHkL: goto GxJAV;
KbGmw:
}
}
© 2023 Quttera Ltd. All rights reserved.