<?php
//Obfuscated by YAK Pro - Php Obfuscator 2.0.13 at 2025-05-27 11:01:59
 namespace App\Http\Controllers\Admin; use App\Helpers\Helper; use App\Http\Controllers\Controller; use Illuminate\Http\Request; use Illuminate\Support\Arr; use App\Subscribe; use App\Http\Resources\Admin\SubscribeResource; use Validator; class SubscribeController extends Controller { const ITEM_PER_PAGE = 100; public function index(Request $request) { goto cpooq; KuG10: $AL2T9->where("\x69\x73\x5f\141\143\164\x69\x76\141\x74\145\x64", $zTW3T); N9sJi: $AL2T9->orderBy("\x69\144", "\x44\x45\x53\x43"); goto dVBzF; dVBzF: return SubscribeResource::collection($AL2T9->paginate($IrgrR)); goto SMZSS; cpooq: $m6vAf = $request->all(); $AL2T9 = Subscribe::notDeleted(); $IrgrR = Arr::get($m6vAf, "\154\151\155\x69\x74", static::ITEM_PER_PAGE); goto rPzU6; rPzU6: $HP71j = Arr::get($m6vAf, "\x6b\x65\171\x77\x6f\162\144", ''); $zTW3T = Arr::get($m6vAf, "\x73\x74\141\164\165\x73", ''); if (empty($HP71j)) { goto RjSVB; } goto OqKW6; OqKW6: $AL2T9->where("\145\x6d\141\151\x6c", "\x4c\x49\x4b\x45", "\45" . $HP71j . "\x25"); RjSVB: if (!($zTW3T != '')) { goto N9sJi; } goto KuG10; SMZSS: } public function all(Request $request) { $m6vAf = $request->all(); $IrgrR = Arr::get($m6vAf, "\x6c\x69\x6d\x69\x74", static::ITEM_PER_PAGE); $AL2T9 = Subscribe::select("\x2a")->notDeleted()->orderBy("\151\144", "\x44\x45\x53\x43"); return SubscribeResource::collection($AL2T9->paginate($IrgrR)); } public function available(Request $request) { $AL2T9 = Subscribe::select("\x2a")->isPublished()->orderBy("\151\x64", "\x44\x45\x53\x43"); return SubscribeResource::collection($AL2T9->get()); } public function show($J7Qyc = 0) { $CdySE = Subscribe::notDeleted()->where("\151\144", $J7Qyc)->first(); if (isset($CdySE)) { goto iAjlW; } return response()->json(["\145\162\162\157\x72\x73" => "\x53\x75\142\x73\143\x72\x69\142\x65\40\x69\x73\x20\156\x6f\x74\x20\x76\x61\154\151\144"], 403); iAjlW: return new SubscribeResource($CdySE); } public function store(Request $request) { goto UhKvK; FAJik: $CdySE = Subscribe::create(["\x6e\141\155\145" => $params["\x6e\x61\155\145"], "\x73\154\165\x67" => Helper::slug($a8BdO), "\160\x61\x72\145\156\164\137\151\x64" => $WJdG3, "\151\x6d\141\147\x65" => $params["\151\x6d\141\147\145"], "\163\165\x62\x5f\x74\151\x74\x6c\x65" => $params["\x73\165\142\137\x74\x69\x74\x6c\145"], "\147\x72\x6f\x75\x70" => $params["\x67\x72\x6f\165\x70"], "\x64\x65\x73\143\162\151\160\164\x69\x6f\156" => $params["\x64\145\163\143\x72\x69\160\x74\151\x6f\156"], "\162\x61\156\x6b" => $params["\162\141\x6e\153"] != null && $params["\162\x61\x6e\153"] != '' ? $params["\x72\x61\156\153"] : null, "\160\x6f\163\x69\164\151\x6f\x6e" => $FpFq0, "\151\x73\137\141\x63\x74\151\x76\x61\x74\145\x64" => $params["\151\163\x5f\x61\x63\x74\x69\x76\x61\x74\145\x64"] === true ? 1 : 0, "\143\162\145\x61\x74\x65\144\137\141\164" => date("\131\55\155\55\144\40\110\x3a\151\72\163"), "\x75\160\x64\141\x74\x65\144\137\x61\x74" => date("\131\x2d\155\55\x64\40\x48\72\x69\x3a\163")]); return new SubscribeResource($CdySE); goto qrxSl; D6gHf: if (!($a8BdO == null || $a8BdO == '')) { goto VQz2c; } $a8BdO = Helper::slug($params["\156\x61\155\145"]); VQz2c: goto TUxt0; e1CnM: if (!(is_array($params["\160\x61\162\145\x6e\x74\137\151\144"]) && isset($params["\160\141\162\145\156\164\137\151\144"][array_key_last($params["\x70\x61\x72\x65\x6e\164\x5f\x69\144"])]))) { goto oJkoB; } $WJdG3 = $params["\x70\141\162\x65\156\164\x5f\151\144"][array_key_last($params["\160\x61\x72\x65\156\x74\x5f\151\x64"])]; oJkoB: goto FAJik; XLlUc: i0XR8: $params = $request->all(); $a8BdO = $params["\x73\154\165\147"]; goto D6gHf; Iq_Rt: $FpFq0++; BEzgB: $WJdG3 = 0; goto e1CnM; TUxt0: $pNQTw = Subscribe::where("\x69\163\137\x64\145\x6c\145\164\x65\144", false)->orderBy("\160\x6f\x73\151\x74\151\x6f\156", "\x64\145\163\x63")->first(); $FpFq0 = isset($pNQTw) ? $pNQTw->position : 0; if (!($FpFq0 > 0)) { goto BEzgB; } goto Iq_Rt; UhKvK: $siLxR = Validator::make($request->all(), ["\x6e\x61\155\145" => ["\x72\145\x71\165\151\162\145\144"], "\x69\163\137\141\143\164\151\x76\141\x74\x65\x64" => ["\162\x65\x71\165\151\x72\145\144"]]); if (!$siLxR->fails()) { goto i0XR8; } return response()->json(["\x65\162\x72\x6f\162\x73" => $siLxR->errors()], 403); goto XLlUc; qrxSl: } public function update(Request $request, $J7Qyc = 0) { goto aOrNu; M_oTN: of3yk: $WJdG3 = 0; if (!(is_array($params["\x70\141\x72\145\x6e\164\x5f\151\x64"]) && isset($params["\160\x61\x72\x65\x6e\x74\137\151\x64"][array_key_last($params["\x70\x61\x72\x65\156\x74\137\x69\x64"])]))) { goto z3_vk; } goto VFQzS; U9C7n: xeuDF: $CdySE = Subscribe::notDeleted()->where("\151\x64", $J7Qyc)->first(); if (isset($CdySE)) { goto VuA0r; } goto fSFD4; fSFD4: return response()->json(["\x65\x72\x72\157\162\x73" => "\123\x75\142\x73\143\x72\x69\142\145\x20\151\x73\40\x6e\157\x74\40\166\141\154\151\144"], 403); VuA0r: $params = $request->all(); goto LYor7; LYor7: $a8BdO = $params["\163\x6c\x75\x67"]; if (!($a8BdO == null || $a8BdO == '')) { goto of3yk; } $a8BdO = Helper::slug($params["\156\x61\x6d\x65"]); goto M_oTN; QpNHd: return response()->json(null, 204); goto eRFFe; aOrNu: $siLxR = Validator::make($request->all(), ["\x6e\x61\x6d\x65" => ["\x72\145\x71\165\151\162\x65\144"], "\x69\x73\137\x61\x63\x74\x69\x76\x61\164\145\144" => ["\162\x65\x71\x75\151\x72\x65\144"]]); if (!$siLxR->fails()) { goto xeuDF; } return response()->json(["\x65\162\x72\x6f\162\x73" => $siLxR->errors()], 403); goto U9C7n; VFQzS: $WJdG3 = $params["\160\141\x72\x65\156\x74\137\x69\144"][array_key_last($params["\x70\x61\x72\x65\156\164\137\151\x64"])]; z3_vk: $CdySE->update(["\156\141\x6d\145" => $params["\x6e\x61\155\x65"], "\163\154\x75\147" => Helper::slug($a8BdO), "\160\x61\x72\145\x6e\164\x5f\x69\144" => $WJdG3, "\x69\155\x61\x67\145" => $params["\151\155\141\x67\x65"], "\163\165\x62\137\x74\151\164\154\x65" => $params["\x73\x75\x62\x5f\x74\x69\x74\154\145"], "\147\x72\157\x75\x70" => $params["\x67\x72\x6f\165\x70"], "\144\145\163\x63\162\151\160\x74\151\157\x6e" => $params["\144\x65\x73\x63\162\x69\160\164\151\157\156"], "\162\141\156\x6b" => $params["\162\141\156\x6b"] != null && $params["\162\x61\156\x6b"] != '' ? $params["\x72\x61\156\153"] : null, "\151\x73\x5f\x61\143\164\151\166\141\x74\145\144" => $params["\x69\163\x5f\141\143\x74\x69\x76\x61\x74\145\144"] === true ? 1 : 0, "\165\x70\144\x61\164\145\144\137\141\x74" => date("\x59\x2d\155\x2d\144\x20\110\72\x69\72\x73")]); goto QpNHd; eRFFe: } public function destroy($J7Qyc = 0) { $CdySE = Subscribe::notDeleted()->where("\151\144", $J7Qyc)->first(); if (isset($CdySE)) { goto KgnW3; } response()->json(["\x65\162\162\157\x72" => "\x45\x68\150\150\41\40\103\141\156\40\156\x6f\164\x20\x64\x65\154\x65\164\x65\40\x74\150\x69\x73\40\163\165\142\x73\x63\162\x69\x62\145"], 403); KgnW3: try { $CdySE->update(["\151\163\x5f\144\145\154\x65\164\x65\x64" => true]); } catch (\Exception $ngK2R) { response()->json(["\x65\162\162\157\x72" => $ngK2R->getMessage()], 403); } return response()->json(null, 204); } public function destroyMultiple(Request $request) { goto ojFEZ; TGuYq: try { Subscribe::notDeleted()->whereIn("\151\x64", $jGmeT)->update(["\151\x73\137\x64\145\x6c\145\164\x65\x64" => true]); } catch (\Exception $ngK2R) { response()->json(["\145\x72\162\x6f\x72" => $ngK2R->getMessage()], 403); } return response()->json(null, 204); goto YKJwF; OSSSQ: if (!($uDtSE->count() <= 0)) { goto o5wBy; } response()->json(["\145\162\162\x6f\x72" => "\x53\x75\142\163\x63\162\151\x62\x65\x20\151\x73\40\156\x6f\x74\x20\x76\141\x6c\x69\144\x2e"], 403); o5wBy: goto TGuYq; ojFEZ: $siLxR = Validator::make($request->all(), ["\151\x64\163" => "\162\145\161\165\x69\x72\x65\144"]); if (!$siLxR->fails()) { goto AsBrf; } return response()->json(["\145\x72\x72\157\162\163" => $siLxR->errors()], 403); goto gDX0B; gDX0B: AsBrf: $jGmeT = $request->get("\151\x64\x73", []); $uDtSE = Subscribe::notDeleted()->whereIn("\151\x64", $jGmeT)->get(); goto OSSSQ; YKJwF: } public function activateMultiple(Request $request) { goto eQhGs; FzDu_: try { Subscribe::notDeleted()->whereIn("\x69\x64", $jGmeT)->update(["\x69\163\x5f\x61\143\164\151\x76\141\164\145\144" => true]); } catch (\Exception $ngK2R) { response()->json(["\x65\162\x72\x6f\x72" => $ngK2R->getMessage()], 403); } return response()->json(null, 204); goto NpTi0; NQ6XK: if (!($uDtSE->count() <= 0)) { goto oFnme; } response()->json(["\x65\x72\x72\x6f\x72" => "\123\165\x62\163\143\x72\151\142\145\40\151\163\x20\156\x6f\x74\40\166\x61\x6c\x69\x64\x2e"], 403); oFnme: goto FzDu_; eQhGs: $siLxR = Validator::make($request->all(), ["\151\x64\x73" => "\162\x65\161\x75\151\x72\x65\x64"]); if (!$siLxR->fails()) { goto mdIaJ; } return response()->json(["\x65\x72\x72\x6f\x72\163" => $siLxR->errors()], 403); goto Hitio; Hitio: mdIaJ: $jGmeT = $request->get("\151\144\163", []); $uDtSE = Subscribe::notDeleted()->whereIn("\x69\x64", $jGmeT)->get(); goto NQ6XK; NpTi0: } public function deactivateMultiple(Request $request) { goto eA4n5; EKPc2: if (!($uDtSE->count() <= 0)) { goto wggmb; } response()->json(["\145\x72\162\157\x72" => "\123\x75\x62\163\143\x72\151\x62\145\40\151\x73\x20\x6e\x6f\x74\x20\166\x61\x6c\x69\x64\56"], 403); wggmb: goto RVfik; zhd4O: QJShU: $jGmeT = $request->get("\x69\144\x73", []); $uDtSE = Subscribe::notDeleted()->whereIn("\151\144", $jGmeT)->get(); goto EKPc2; RVfik: try { Subscribe::notDeleted()->whereIn("\x69\x64", $jGmeT)->update(["\x69\x73\x5f\x61\x63\164\x69\x76\x61\164\x65\144" => false]); } catch (\Exception $ngK2R) { response()->json(["\x65\x72\x72\157\x72" => $ngK2R->getMessage()], 403); } return response()->json(null, 204); goto vLfzl; eA4n5: $siLxR = Validator::make($request->all(), ["\x69\x64\x73" => "\162\x65\x71\165\151\x72\145\144"]); if (!$siLxR->fails()) { goto QJShU; } return response()->json(["\145\162\162\157\x72\163" => $siLxR->errors()], 403); goto zhd4O; vLfzl: } public function position(Request $request) { goto FWdcK; FWdcK: if ($request->has("\x70\157\x73\151\x74\x69\x6f\156")) { goto B5I9V; } return response()->json(["\x65\x72\162\157\x72\163" => "\x44\x61\164\x61\40\151\163\x20\x69\x6e\x76\141\154\151\x64"], 403); B5I9V: goto PWGEQ; PWGEQ: $BjNfF = $request->position; if (!is_array($BjNfF)) { goto ENskb; } foreach ($BjNfF as $GrcVU) { Subscribe::where("\x69\x64", $GrcVU["\x69\144"])->update(["\x70\x6f\x73\151\164\151\x6f\156" => $GrcVU["\x6f\162\144\x65\162"]]); N7nhh: } goto k6jvb; k6jvb: mth29: ENskb: return response()->json(null, 204); goto GWXRW; GWXRW: } }