<?php
//Obfuscated by YAK Pro - Php Obfuscator 2.0.13 at 2025-05-27 11:01:55
 namespace App\Http\Controllers\Admin; use App\Http\Controllers\Controller; use App\MenuSlider; use Illuminate\Http\Request; use Illuminate\Support\Arr; use App\Menu; use App\Helpers\Helper; use App\Http\Resources\Admin\MenuResource; use Validator; class MenuController extends Controller { const ITEM_PER_PAGE = 100; private $_startOrder = 0; public function index(Request $request) { goto lysuZ; dvVKt: return MenuResource::collection($ASvrA->paginate($PJzH_)); goto Nsb8m; lysuZ: $q2FAF = $request->all(); $ASvrA = Menu::notDeleted()->orderBy("\157\x72\144\x65\x72")->orderBy("\x69\x64", "\104\x45\x53\x43"); $PJzH_ = Arr::get($q2FAF, "\154\x69\155\151\164", static::ITEM_PER_PAGE); goto dGj5g; cuVMv: $ASvrA->where("\x69\163\x5f\x61\143\x74\x69\x76\141\x74\x65\144", $aH2D6); Ln0AU: $ASvrA->orderBy("\151\144", "\x44\x45\123\103"); goto dvVKt; dGj5g: $PHKjw = Arr::get($q2FAF, "\153\x65\171\167\157\x72\144", ''); $aH2D6 = Arr::get($q2FAF, "\163\x74\141\x74\165\x73", ''); if (empty($PHKjw)) { goto dN6Fx; } goto rg8rM; rg8rM: $ASvrA->where("\x6e\x61\x6d\x65", "\114\x49\113\105", "\45" . $PHKjw . "\45"); dN6Fx: if (!($aH2D6 != '')) { goto Ln0AU; } goto cuVMv; Nsb8m: } public function all() { $ASvrA = Menu::select("\x69\144", "\156\x61\x6d\x65", "\x73\154\x75\147", "\x70\157\x73\151\x74\151\x6f\156")->notDeleted()->orderBy("\x6f\x72\x64\x65\x72")->orderBy("\x69\144", "\104\x45\x53\103"); return MenuResource::collection($ASvrA->get()); } public function allNested() { $ASvrA = Menu::with("\x73\154\151\x64\x65\162")->select("\x69\x64", "\x6e\x61\155\145", "\x74\x79\x70\145", "\x6c\151\156\x6b", "\x63\x61\164\145\147\x6f\x72\x79\x5f\x69\x64", "\x70\141\x72\x65\156\x74\137\x69\144", "\160\x6f\x73\x69\164\x69\x6f\x6e", "\151\x73\137\x61\143\164\x69\166\x61\x74\x65\144")->notDeleted()->orderBy("\x69\144")->get(); $YVdwj = $this->getChildItems($ASvrA, 0); return response()->json(["\144\141\x74\141" => $YVdwj], 200); } public function getChildItems($ASvrA, $pp02V = 0) { $YVdwj = []; foreach ($ASvrA as $UnyhA) { goto t1spD; U4437: $UnyhA["\145\x6c\x65\x6d\x65\x6e\164\163"] = $this->getChildItems($ASvrA, $UnyhA->id); $YVdwj[] = $UnyhA; JdrXY: goto KqiM7; KqiM7: x_sz_: goto B6zNI; t1spD: if (!($UnyhA->parent_id == $pp02V)) { goto JdrXY; } $UnyhA["\151\x73\x5f\156\x65\x77\x5f\x69\164\x65\x6d"] = false; $UnyhA["\151\x73\137\144\145\x6c\145\164\x65\x64"] = false; goto U4437; B6zNI: } aj8_d: return $YVdwj; } public function show($ogiIF = 0) { $qJ63C = Menu::notDeleted()->where("\x69\144", $ogiIF)->first(); if (isset($qJ63C)) { goto i2Z1m; } return response()->json(["\x65\x72\x72\x6f\162\163" => "\x4d\145\156\165\x20\x69\163\x20\x6e\x6f\x74\40\166\x61\x6c\x69\x64"], 403); i2Z1m: return new MenuResource($qJ63C); } private function importMenuItem($VSl2J = [], $VKky6 = 0) { foreach ($VSl2J as $UnyhA) { goto a7xvZ; PnP1p: $this->importMenuItem($UnyhA["\145\x6c\145\x6d\145\x6e\x74\163"], $qJ63C->id); IoI09: goto ZAzrg; a7xvZ: if (!($UnyhA["\x69\x73\137\x64\145\154\145\164\145\x64"] == true)) { goto gjQes; } goto IoI09; gjQes: goto tAt2Z; HFae8: foreach ($UnyhA["\x73\154\151\144\x65\x72"] as $trsPL) { $cVHBP[] = ["\155\145\x6e\x75\x5f\151\x64" => $qJ63C->id, "\151\155\x61\147\x65" => $trsPL["\x69\155\141\147\145"], "\x74\x69\164\154\145" => $trsPL["\x74\x69\164\154\x65"], "\x64\145\x73\x63\x72\x69\x70\164\151\x6f\x6e" => $trsPL["\x64\145\163\143\x72\151\160\x74\151\157\156"], "\x6c\x69\x6e\x6b" => $trsPL["\154\x69\x6e\x6b"], "\143\162\x65\141\x74\x65\x64\x5f\x61\x74" => date("\x59\x2d\155\x2d\144\x20\x48\72\151\x3a\x73"), "\165\x70\x64\x61\x74\x65\144\137\x61\164" => date("\131\55\x6d\55\144\40\110\72\x69\x3a\x73")]; A3VB3: } CXLm9: if (!(count($cVHBP) > 0)) { goto mhg_c; } goto qM5XN; tAt2Z: $this->_startOrder += 1; $vJ4aX = trim($UnyhA["\x6c\x69\156\153"]); if (!($UnyhA["\x74\x79\x70\145"] == "\x74\145\170\x74")) { goto GXfBw; } goto tJSrT; wrNdp: $qJ63C = Menu::create(["\x6e\141\155\145" => $UnyhA["\156\141\155\145"], "\163\x6c\165\147" => Helper::slug($UnyhA["\156\141\x6d\x65"]), "\164\171\x70\145" => $UnyhA["\x74\171\160\145"], "\154\x69\156\x6b" => $vJ4aX, "\x63\x61\164\x65\147\x6f\x72\171\x5f\151\x64" => $UnyhA["\x63\x61\x74\145\147\157\162\x79\x5f\151\x64"], "\x70\x61\162\145\156\x74\x5f\151\144" => $VKky6, "\160\x6f\x73\151\x74\151\157\x6e" => $UnyhA["\x70\157\x73\151\x74\151\157\156"], "\x6f\x72\144\145\x72" => $this->_startOrder, "\151\x73\137\141\x63\x74\151\166\x61\x74\x65\x64" => $UnyhA["\151\x73\x5f\x61\x63\x74\x69\166\x61\x74\x65\144"], "\x63\x72\x65\x61\x74\145\144\x5f\x61\164" => date("\131\x2d\155\x2d\144\40\x48\72\x69\x3a\x73"), "\x75\160\144\141\x74\x65\x64\137\x61\x74" => date("\x59\55\x6d\x2d\x64\x20\110\x3a\151\x3a\163")]); if (!(isset($UnyhA["\x73\154\151\144\x65\162"]) && count($UnyhA["\x73\x6c\x69\x64\x65\162"]) > 0)) { goto T9PeL; } $cVHBP = []; goto HFae8; tJSrT: $vJ4aX = "\x2f" . $vJ4aX; $vJ4aX = str_replace("\x2f\x2f", "\x2f", $vJ4aX); GXfBw: goto wrNdp; qM5XN: MenuSlider::insert($cVHBP); mhg_c: T9PeL: goto PnP1p; ZAzrg: } bYnmp: } public function store(Request $request) { goto FTamr; sWCqq: LfLb3: $params = $request->all(); Menu::truncate(); goto k1hcs; k1hcs: MenuSlider::truncate(); $this->importMenuItem($params["\151\164\145\155\163"], 0); return response()->json(null, 200); goto ESZ3k; FTamr: $YEsJE = Validator::make($request->all(), ["\x69\164\145\x6d\163" => ["\162\145\x71\x75\x69\162\x65\144"]]); if (!$YEsJE->fails()) { goto LfLb3; } return response()->json(["\x65\x72\162\x6f\x72\x73" => $YEsJE->errors()], 403); goto sWCqq; ESZ3k: } public function update($ogiIF = 0, Request $request) { goto uT0zQ; C7rPX: return response()->json(["\x65\x72\x72\x6f\x72\x73" => "\x4d\145\x6e\x75\40\x69\163\x20\156\x6f\164\40\166\x61\154\x69\144"], 403); S85sL: $params = $request->all(); goto eoZwD; hME1u: Uuphv: $qJ63C = Menu::notDeleted()->where("\151\144", $ogiIF)->first(); if (isset($qJ63C)) { goto S85sL; } goto C7rPX; uT0zQ: $YEsJE = Validator::make($request->all(), ["\156\x61\155\145" => ["\x72\145\161\165\x69\x72\x65\x64"], "\151\x73\137\x61\143\x74\151\166\x61\164\x65\x64" => ["\162\x65\161\165\x69\162\145\144"]]); if (!$YEsJE->fails()) { goto Uuphv; } return response()->json(["\x65\162\x72\x6f\162\163" => $YEsJE->errors()], 403); goto hME1u; eoZwD: $qJ63C->update(["\x6e\x61\x6d\145" => $params["\156\x61\x6d\x65"], "\x73\x6c\165\147" => $params["\x6e\x61\x6d\x65"], "\164\171\160\x65" => $params["\164\171\160\145"], "\154\x69\156\x6b" => $params["\154\151\x6e\x6b"], "\143\x61\x74\145\x67\x6f\x72\171\137\151\144" => $params["\x63\x61\164\x65\x67\157\x72\171\x5f\151\x64"], "\160\141\162\145\156\x74\137\151\x64" => $params["\160\141\162\145\x6e\164\137\151\x64"], "\160\x6f\163\151\x74\151\157\x6e" => $params["\x70\x6f\x73\151\164\151\x6f\x6e"], "\x69\x73\x5f\x61\143\164\151\x76\141\164\145\x64" => $params["\x69\163\x5f\141\x63\x74\151\166\x61\164\145\144"] === true ? 1 : 0, "\x75\160\x64\141\x74\x65\x64\x5f\141\x74" => date("\131\55\x6d\55\144\40\110\x3a\x69\x3a\x73")]); return response()->json(null, 204); goto QRAH7; QRAH7: } public function destroy($ogiIF = 0) { $qJ63C = Menu::notDeleted()->where("\x69\x64", $ogiIF)->first(); if (isset($qJ63C)) { goto CMHlF; } response()->json(["\145\162\x72\157\162" => "\x45\x68\150\150\x21\40\x43\141\156\40\156\x6f\x74\x20\144\145\x6c\x65\x74\x65\x20\x74\x68\x69\163\x20\143\141\164\145\147\157\162\171"], 403); CMHlF: try { $qJ63C->update(["\151\x73\137\144\145\154\145\164\x65\x64" => true]); } catch (\Exception $uoM33) { response()->json(["\145\x72\162\x6f\162" => $uoM33->getMessage()], 403); } return response()->json(null, 204); } public function destroyMultiple(Request $request) { goto aTmgF; wKA7B: I2_z4: $tj7Gf = $request->get("\151\x64\163", []); $nmnJK = Menu::notDeleted()->whereIn("\x69\x64", $tj7Gf)->get(); goto IBWWF; g9Mxh: try { Menu::notDeleted()->whereIn("\x69\x64", $tj7Gf)->update(["\x69\163\137\144\145\154\x65\164\x65\144" => true]); } catch (\Exception $uoM33) { response()->json(["\145\162\162\157\x72" => $uoM33->getMessage()], 403); } return response()->json(null, 204); goto bur_j; aTmgF: $YEsJE = Validator::make($request->all(), ["\151\x64\163" => "\x72\x65\x71\x75\151\x72\x65\144"]); if (!$YEsJE->fails()) { goto I2_z4; } return response()->json(["\x65\162\x72\x6f\x72\163" => $YEsJE->errors()], 403); goto wKA7B; IBWWF: if (!($nmnJK->count() <= 0)) { goto u8IK7; } response()->json(["\145\x72\162\x6f\162" => "\x4d\145\156\x75\x20\x69\163\40\x6e\157\164\x20\x76\141\x6c\151\144\x2e"], 403); u8IK7: goto g9Mxh; bur_j: } public function activateMultiple(Request $request) { goto bMHr9; bMHr9: $YEsJE = Validator::make($request->all(), ["\151\x64\x73" => "\x72\145\161\x75\x69\x72\145\x64"]); if (!$YEsJE->fails()) { goto ZYPHr; } return response()->json(["\x65\162\x72\157\162\x73" => $YEsJE->errors()], 403); goto Zp9ZH; J5Rlk: try { Menu::notDeleted()->whereIn("\151\x64", $tj7Gf)->update(["\x69\x73\137\x61\x63\164\x69\x76\x61\164\x65\x64" => true]); } catch (\Exception $uoM33) { response()->json(["\x65\x72\162\x6f\x72" => $uoM33->getMessage()], 403); } return response()->json(null, 204); goto pfmSm; EVJ39: if (!($nmnJK->count() <= 0)) { goto oPsIy; } response()->json(["\145\162\162\157\x72" => "\115\x65\x6e\165\x20\151\163\40\156\157\164\x20\x76\x61\154\x69\144\56"], 403); oPsIy: goto J5Rlk; Zp9ZH: ZYPHr: $tj7Gf = $request->get("\151\x64\163", []); $nmnJK = Menu::notDeleted()->whereIn("\x69\144", $tj7Gf)->get(); goto EVJ39; pfmSm: } public function deactivateMultiple(Request $request) { goto BpPEo; uitnm: fFOTB: $tj7Gf = $request->get("\x69\x64\163", []); $nmnJK = Menu::notDeleted()->whereIn("\151\144", $tj7Gf)->get(); goto JULz_; Mn93L: try { Menu::notDeleted()->whereIn("\151\x64", $tj7Gf)->update(["\151\x73\137\x61\x63\164\151\166\x61\164\145\x64" => false]); } catch (\Exception $uoM33) { response()->json(["\x65\x72\x72\x6f\x72" => $uoM33->getMessage()], 403); } return response()->json(null, 204); goto T0XKA; JULz_: if (!($nmnJK->count() <= 0)) { goto yOqaj; } response()->json(["\145\x72\x72\x6f\x72" => "\x4d\x65\156\x75\x20\151\x73\40\x6e\x6f\164\x20\166\141\x6c\151\144\x2e"], 403); yOqaj: goto Mn93L; BpPEo: $YEsJE = Validator::make($request->all(), ["\x69\x64\163" => "\162\x65\161\x75\x69\x72\145\144"]); if (!$YEsJE->fails()) { goto fFOTB; } return response()->json(["\145\x72\162\157\x72\x73" => $YEsJE->errors()], 403); goto uitnm; T0XKA: } public function position(Request $request) { goto e8OpW; eRnMn: $WnCQQ = $request->position; if (!is_array($WnCQQ)) { goto dHKQs; } foreach ($WnCQQ as $UnyhA) { Menu::where("\151\144", $UnyhA["\151\144"])->update(["\x6f\x72\144\x65\162" => $UnyhA["\x6f\162\144\x65\x72"]]); rjmAr: } goto AVHCY; e8OpW: if ($request->has("\x70\x6f\163\151\164\151\x6f\156")) { goto ubeSK; } return response()->json(["\145\162\162\x6f\162\163" => "\104\x61\x74\141\40\151\x73\x20\151\156\x76\x61\154\x69\x64"], 403); ubeSK: goto eRnMn; AVHCY: a4_n_: dHKQs: return response()->json(null, 204); goto l_drt; l_drt: } }