<?php
//Obfuscated by YAK Pro - Php Obfuscator 2.0.13 at 2025-05-27 11:01:54
 namespace App\Http\Controllers\Admin; use App\Http\Controllers\Controller; use Firebase\JWT\Key; use Illuminate\Http\Request; use Illuminate\Support\Arr; use App\Keyword; use App\Http\Resources\Admin\KeywordResource; use Validator; class KeywordController extends Controller { const ITEM_PER_PAGE = 20; public function index(Request $request) { goto MryMC; Q3z8V: $uHaIe = Arr::get($i4FB3, "\153\x65\x79\x77\x6f\x72\x64", ''); $T51FU = Arr::get($i4FB3, "\162\145\154\141\x74\x65", ''); $FNjNM = Arr::get($i4FB3, "\156\157\164\145", ''); goto dHzO1; H6_3n: iu6YI: $xC7L2->orderBy("\x70\x6f\x73\151\x74\x69\x6f\156")->orderBy("\x69\144", "\x44\x45\123\x43"); return KeywordResource::collection($xC7L2->paginate($K37MB)); goto EFIPm; jqFUe: ps06T: if (!($T51FU != '')) { goto Y1doz; } $xC7L2->where("\151\x73\137\162\145\x6c\141\164\x65\144", $T51FU); goto cXW1V; cXW1V: Y1doz: if (!($FNjNM != '')) { goto jMJQP; } $xC7L2->where("\151\x73\x5f\156\x6f\164\145", $FNjNM); goto hEyAl; MryMC: $i4FB3 = $request->all(); $xC7L2 = Keyword::notDeleted(); $K37MB = Arr::get($i4FB3, "\x6c\151\155\151\x74", static::ITEM_PER_PAGE); goto Q3z8V; dHzO1: $WIrjc = Arr::get($i4FB3, "\163\x74\141\x74\x75\163", ''); if (empty($uHaIe)) { goto ps06T; } $xC7L2->where("\x6e\x61\155\145", "\114\x49\113\105", "\x25" . $uHaIe . "\x25"); goto jqFUe; hEyAl: jMJQP: if (!($WIrjc != '')) { goto iu6YI; } $xC7L2->where("\151\163\137\141\143\164\151\166\141\164\x65\144", $WIrjc); goto H6_3n; EFIPm: } public function all() { $xC7L2 = Keyword::select("\x69\x64", "\156\x61\x6d\145")->notDeleted()->orderBy("\160\x6f\163\x69\164\151\x6f\x6e")->orderBy("\x69\144"); return KeywordResource::collection($xC7L2->get()); } public function show($WKm4h = 0) { $uHaIe = Keyword::notDeleted()->where("\151\x64", $WKm4h)->first(); if (isset($uHaIe)) { goto vdMGa; } return response()->json(["\145\162\162\x6f\162\x73" => "\113\x65\x79\x77\x6f\x72\x64\40\151\x73\x20\156\x6f\164\x20\166\x61\x6c\x69\144"], 403); vdMGa: return new KeywordResource($uHaIe); } public function store(Request $request) { goto ncpEK; Il1JH: return new KeywordResource($uHaIe); goto TMNIL; hE1T8: $QArAV++; XQetx: $uHaIe = Keyword::create(["\x6e\141\155\145" => $params["\156\x61\155\x65"], "\144\145\163\x63\162\151\160\164\151\x6f\156" => $params["\x64\x65\x73\x63\x72\151\160\164\x69\157\156"], "\160\157\163\x69\x74\x69\x6f\156" => $QArAV + 1, "\x69\x73\x5f\x6e\157\164\145" => false, "\x69\163\137\x72\x65\154\141\x74\145\x64" => false, "\151\163\137\x61\x63\x74\x69\x76\141\x74\x65\x64" => $params["\151\163\x5f\x61\143\x74\151\166\x61\x74\x65\x64"] === true ? 1 : 0, "\x63\x72\145\x61\x74\145\x64\137\141\x74" => date("\x59\55\155\x2d\144\x20\110\72\151\x3a\163"), "\165\160\144\x61\x74\145\x64\x5f\x61\x74" => date("\x59\55\155\x2d\144\x20\x48\72\x69\72\x73")]); goto Il1JH; UEgIB: L_ODQ: $params = $request->all(); $tvIrY = Keyword::where("\156\141\155\145", $params["\x6e\141\x6d\x65"])->where("\151\x73\x5f\141\143\x74\151\166\141\164\145\x64", true)->where("\151\x73\137\144\145\x6c\145\164\x65\144", false)->first(); goto rMoZC; ncpEK: $yq49_ = Validator::make($request->all(), ["\156\141\x6d\x65" => ["\x72\x65\x71\165\x69\162\x65\x64"], "\x69\x73\137\141\143\164\x69\166\x61\x74\145\144" => ["\x72\x65\161\x75\x69\162\x65\144"]]); if (!$yq49_->fails()) { goto L_ODQ; } return response()->json(["\x65\x72\162\x6f\x72\163" => $yq49_->errors()], 403); goto UEgIB; niFdm: $cbDJA = Keyword::where("\151\163\x5f\144\x65\x6c\145\x74\x65\x64", false)->orderBy("\x70\x6f\163\x69\x74\x69\157\x6e", "\x64\x65\x73\x63")->first(); $QArAV = isset($cbDJA) ? $cbDJA->position : 0; if (!($QArAV > 0)) { goto XQetx; } goto hE1T8; rMoZC: if (!(isset($tvIrY) && $tvIrY->id != null)) { goto ZTzW1; } return response()->json(["\144\141\164\x61" => ["\x73\164\x61\x74\x75\163" => "\145\x72\x72\157\162", "\x6d\145\x73\x73\141\147\145" => "\x4b\x65\x79\x77\x6f\x72\x64\x20\141\x6c\162\x65\141\x64\171\x20\x65\170\151\x73\x74\163\56"]], 200); ZTzW1: goto niFdm; TMNIL: } public function update(Request $request, $WKm4h = 0) { goto uqPTL; uqPTL: $yq49_ = Validator::make($request->all(), ["\156\x61\x6d\x65" => ["\x72\145\161\165\x69\162\x65\x64"], "\151\163\x5f\141\143\x74\151\x76\x61\x74\145\x64" => ["\162\x65\161\x75\151\x72\145\x64"]]); if (!$yq49_->fails()) { goto wVKco; } return response()->json(["\x65\162\x72\x6f\x72\x73" => $yq49_->errors()], 403); goto w9PiJ; c0AoW: return response()->json(["\x65\162\162\157\162\x73" => "\113\145\x79\x77\157\x72\x64\40\151\x73\40\156\157\164\40\x76\x61\154\x69\x64"], 403); xxrSV: $params = $request->all(); goto k230d; w9PiJ: wVKco: $uHaIe = Keyword::notDeleted()->where("\151\x64", $WKm4h)->first(); if (isset($uHaIe)) { goto xxrSV; } goto c0AoW; k230d: $tvIrY = Keyword::where("\156\141\x6d\145", $params["\156\x61\155\145"])->where("\151\163\x5f\x61\143\x74\x69\166\141\164\x65\144", true)->where("\151\x73\x5f\x64\145\x6c\145\x74\x65\x64", false)->where("\151\x64", "\x21\75", $uHaIe->id)->first(); if (!(isset($tvIrY) && $tvIrY->id != null)) { goto IGucN; } return response()->json(["\144\x61\164\x61" => ["\x73\x74\x61\x74\x75\163" => "\x65\162\x72\x6f\x72", "\x6d\x65\163\x73\141\147\145" => "\113\145\171\x77\x6f\x72\144\40\141\154\162\x65\x61\144\x79\40\x65\x78\x69\163\x74\163\56"]], 200); goto bMG25; bMG25: IGucN: $uHaIe->update(["\x6e\141\x6d\x65" => $params["\x6e\x61\x6d\145"], "\144\145\163\143\x72\x69\160\164\x69\157\x6e" => $params["\x64\x65\x73\x63\x72\151\160\x74\151\157\156"], "\x69\x73\137\x6e\x6f\164\145" => false, "\151\163\137\162\145\x6c\141\x74\x65\x64" => false, "\x69\x73\137\141\143\164\151\x76\141\x74\145\x64" => $params["\x69\x73\137\141\x63\x74\x69\166\x61\164\145\144"] === true ? 1 : 0, "\165\x70\x64\141\x74\x65\x64\x5f\x61\x74" => date("\x59\x2d\x6d\x2d\x64\x20\x48\x3a\x69\72\x73")]); return response()->json(null, 204); goto yw2WD; yw2WD: } public function tags() { $xC7L2 = Keyword::published()->select("\x6e\141\x6d\145")->orderBy("\x70\157\163\151\x74\151\x6f\156")->get(); return response()->json(["\x64\141\x74\x61" => $xC7L2], 200); } public function destroy($WKm4h = 0) { $uHaIe = Keyword::notDeleted()->where("\x69\144", $WKm4h)->first(); if (isset($uHaIe)) { goto Q5tJy; } response()->json(["\145\x72\x72\x6f\162" => "\x45\150\x68\150\41\x20\x43\141\156\40\156\157\x74\40\x64\x65\154\145\164\145\x20\164\x68\x69\x73\40\143\x61\x74\145\147\157\162\171"], 403); Q5tJy: try { $uHaIe->update(["\151\163\x5f\144\145\x6c\x65\164\145\x64" => true]); } catch (\Exception $L5e8U) { response()->json(["\x65\x72\x72\x6f\x72" => $L5e8U->getMessage()], 403); } return response()->json(null, 204); } public function destroyMultiple(Request $request) { goto KcdKy; X1o2w: bYuNZ: $XBtnr = $request->get("\151\144\163", []); $ElCgd = Keyword::notDeleted()->whereIn("\x69\144", $XBtnr)->get(); goto PoT_s; N8iwI: try { Keyword::notDeleted()->whereIn("\x69\144", $XBtnr)->update(["\x69\x73\137\x64\x65\x6c\x65\164\x65\x64" => true]); } catch (\Exception $L5e8U) { response()->json(["\145\x72\162\157\x72" => $L5e8U->getMessage()], 403); } return response()->json(null, 204); goto bZiNk; PoT_s: if (!($ElCgd->count() <= 0)) { goto ceH_8; } response()->json(["\x65\x72\162\157\x72" => "\113\x65\x79\167\157\162\144\x20\151\163\x20\x6e\157\x74\40\x76\141\154\x69\144\x2e"], 403); ceH_8: goto N8iwI; KcdKy: $yq49_ = Validator::make($request->all(), ["\151\x64\x73" => "\x72\145\x71\165\x69\162\x65\x64"]); if (!$yq49_->fails()) { goto bYuNZ; } return response()->json(["\x65\x72\x72\x6f\x72\163" => $yq49_->errors()], 403); goto X1o2w; bZiNk: } public function activateMultiple(Request $request) { goto IAweQ; XZlPb: U0okY: $XBtnr = $request->get("\151\x64\x73", []); $ElCgd = Keyword::notDeleted()->whereIn("\x69\144", $XBtnr)->get(); goto dgyQL; IAweQ: $yq49_ = Validator::make($request->all(), ["\151\x64\x73" => "\x72\145\161\x75\151\x72\x65\x64"]); if (!$yq49_->fails()) { goto U0okY; } return response()->json(["\145\162\162\x6f\162\x73" => $yq49_->errors()], 403); goto XZlPb; KgyZT: try { Keyword::notDeleted()->whereIn("\x69\x64", $XBtnr)->update(["\151\x73\x5f\141\x63\x74\x69\166\141\x74\x65\144" => true]); } catch (\Exception $L5e8U) { response()->json(["\x65\x72\162\157\x72" => $L5e8U->getMessage()], 403); } return response()->json(null, 204); goto tE1h_; dgyQL: if (!($ElCgd->count() <= 0)) { goto bTmYV; } response()->json(["\145\162\x72\x6f\x72" => "\113\x65\171\x77\x6f\x72\x64\40\x69\x73\40\156\157\164\40\166\x61\x6c\151\x64\x2e"], 403); bTmYV: goto KgyZT; tE1h_: } public function deactivateMultiple(Request $request) { goto RUsrC; u3a9s: djCQ0: $XBtnr = $request->get("\151\x64\x73", []); $ElCgd = Keyword::notDeleted()->whereIn("\151\x64", $XBtnr)->get(); goto yyPAZ; UtGNX: try { Keyword::notDeleted()->whereIn("\x69\x64", $XBtnr)->update(["\151\x73\x5f\x61\x63\x74\x69\x76\141\x74\145\x64" => false]); } catch (\Exception $L5e8U) { response()->json(["\x65\162\x72\x6f\162" => $L5e8U->getMessage()], 403); } return response()->json(null, 204); goto OwzM3; yyPAZ: if (!($ElCgd->count() <= 0)) { goto uzqz7; } response()->json(["\x65\x72\162\157\x72" => "\x4b\145\x79\167\x6f\162\x64\40\x69\163\x20\156\x6f\164\40\x76\141\x6c\151\x64\56"], 403); uzqz7: goto UtGNX; RUsrC: $yq49_ = Validator::make($request->all(), ["\151\144\x73" => "\162\145\161\165\x69\x72\145\144"]); if (!$yq49_->fails()) { goto djCQ0; } return response()->json(["\145\x72\x72\x6f\162\x73" => $yq49_->errors()], 403); goto u3a9s; OwzM3: } public function position(Request $request) { goto ZxtdF; rfWXR: $P3NAC = $request->position; if (!is_array($P3NAC)) { goto d46Ll; } foreach ($P3NAC as $JMrfm) { Keyword::where("\x69\144", $JMrfm["\x69\144"])->update(["\x70\157\163\151\164\151\157\156" => $JMrfm["\x6f\x72\144\x65\162"]]); rsmLT: } goto nDBbx; nDBbx: Jj_rn: d46Ll: return response()->json(null, 204); goto o3R2T; ZxtdF: if ($request->has("\160\x6f\x73\x69\164\x69\x6f\x6e")) { goto h8Hzr; } return response()->json(["\145\x72\162\x6f\x72\163" => "\x44\141\164\141\x20\151\x73\x20\151\156\x76\141\x6c\x69\144"], 403); h8Hzr: goto rfWXR; o3R2T: } }