<?php
//Obfuscated by YAK Pro - Php Obfuscator 2.0.13 at 2025-05-27 11:01:53
 namespace App\Http\Controllers\Admin; use App\Http\Controllers\Controller; use Illuminate\Http\Request; use Illuminate\Support\Arr; use App\Faq; use App\Http\Resources\Admin\FaqResource; use Validator; class FaqController extends Controller { const ITEM_PER_PAGE = 20; public function index(Request $request) { goto rQAVq; Hhw2k: $untsG->where(function ($x5Nar) use($wOZfY) { $x5Nar->where("\x6e\141\155\x65", "\114\x49\113\x45", "\x25{$wOZfY}\x25")->orWhere("\x64\145\163\x63\x72\x69\160\x74\x69\157\156", "\114\111\113\x45", "\x25{$wOZfY}\x25"); }); GDkev: if (!($rXhM1 != '')) { goto RdzmW; } goto TfHzD; TfHzD: $untsG->where("\x69\x73\x5f\x61\x63\164\x69\166\141\x74\x65\144", $rXhM1); RdzmW: $untsG->orderBy("\x69\144", "\x44\105\x53\103"); goto OuheW; rQAVq: $r3iks = $request->all(); $untsG = Faq::notDeleted(); $fLOXc = Arr::get($r3iks, "\x6c\x69\155\x69\x74", static::ITEM_PER_PAGE); goto rDjfh; rDjfh: $wOZfY = Arr::get($r3iks, "\153\145\x79\167\x6f\162\144", ''); $rXhM1 = Arr::get($r3iks, "\x73\x74\141\x74\x75\x73", ''); if (empty($wOZfY)) { goto GDkev; } goto Hhw2k; OuheW: return FaqResource::collection($untsG->paginate($fLOXc)); goto TaeP0; TaeP0: } public function all() { $untsG = Faq::select("\151\x64", "\x6e\x61\155\x65", "\144\x65\x73\x63\x72\151\x70\164\x69\157\x6e")->notDeleted()->orderBy("\151\x64"); return FaqResource::collection($untsG->get()); } public function show($uSrWD = 0) { $zPQ5b = Faq::notDeleted()->where("\x69\144", $uSrWD)->first(); if (isset($zPQ5b)) { goto mzJxF; } return response()->json(["\145\x72\162\157\162\163" => "\x46\101\x51\x20\151\163\x20\156\x6f\x74\x20\166\x61\x6c\151\x64"], 403); mzJxF: return new FaqResource($zPQ5b); } public function store(Request $request) { goto xxHdI; BO1WY: if (!(isset($lDB2k) && $lDB2k->id != null)) { goto fcQz1; } return response()->json(["\x64\x61\x74\141" => ["\163\x74\x61\164\x75\x73" => "\145\x72\x72\157\162", "\x6d\145\x73\163\141\147\145" => "\x46\x41\x51\x20\141\x6c\162\x65\141\144\x79\x20\145\x78\151\x73\x74\163\x2e"]], 200); fcQz1: goto iV6E1; xxHdI: $xVExa = Validator::make($request->all(), ["\x6e\141\x6d\145" => ["\x72\145\161\x75\151\162\145\144"], "\144\x65\x73\x63\x72\151\x70\164\x69\x6f\156" => ["\162\145\x71\x75\x69\x72\145\x64"], "\x69\x73\x5f\141\143\x74\x69\166\x61\x74\x65\144" => ["\162\145\161\165\x69\162\145\144"]]); if (!$xVExa->fails()) { goto gT6gU; } return response()->json(["\x65\162\x72\x6f\162\163" => $xVExa->errors()], 403); goto TS1uq; iV6E1: $zPQ5b = Faq::create(["\x6e\141\x6d\x65" => $params["\156\141\x6d\x65"], "\x64\x65\x73\x63\x72\x69\x70\164\x69\157\156" => $params["\144\x65\163\x63\162\151\160\x74\151\157\156"], "\147\x72\157\165\x70" => $params["\147\162\157\165\160"], "\x69\163\x5f\x61\143\164\x69\166\x61\x74\145\144" => $params["\151\x73\137\x61\x63\x74\151\166\141\164\x65\x64"] === true ? 1 : 0, "\x63\162\145\141\x74\x65\144\x5f\141\164" => date("\x59\55\x6d\x2d\144\40\110\72\151\72\163"), "\x75\x70\x64\141\x74\x65\x64\x5f\x61\x74" => date("\131\55\155\x2d\x64\x20\x48\x3a\x69\x3a\163")]); return new FaqResource($zPQ5b); goto Ob3Yx; TS1uq: gT6gU: $params = $request->all(); $lDB2k = Faq::where("\x6e\141\155\x65", $params["\x6e\x61\155\x65"])->where("\x67\162\x6f\165\x70", $params["\147\x72\x6f\165\x70"])->where("\x69\163\x5f\141\143\x74\x69\x76\x61\x74\x65\x64", true)->where("\x69\x73\x5f\x64\145\154\145\x74\x65\x64", false)->first(); goto BO1WY; Ob3Yx: } public function update($uSrWD = 0, Request $request) { goto tZpBs; SOSQv: HKQrc: $zPQ5b = Faq::notDeleted()->where("\151\144", $uSrWD)->first(); if (isset($zPQ5b)) { goto vcT5h; } goto m3bIU; lvMap: $lDB2k = Faq::where("\156\x61\155\145", $params["\156\x61\155\x65"])->where("\147\x72\x6f\165\x70", $params["\x67\162\157\x75\160"])->where("\151\x73\137\141\143\x74\151\x76\x61\164\x65\x64", true)->where("\151\163\x5f\x64\x65\x6c\145\x74\145\x64", false)->where("\x69\144", "\x21\x3d", $zPQ5b->id)->first(); if (!(isset($lDB2k) && $lDB2k->id != null)) { goto GHYlS; } return response()->json(["\144\x61\x74\141" => ["\x73\164\x61\164\165\x73" => "\x65\162\x72\157\x72", "\x6d\x65\x73\163\x61\147\x65" => "\x46\x41\121\40\x61\x6c\162\x65\x61\x64\x79\x20\145\170\x69\163\x74\163\56"]], 200); goto uo_zl; tZpBs: $xVExa = Validator::make($request->all(), ["\x6e\x61\155\145" => ["\x72\145\161\165\x69\x72\x65\144"], "\x69\x73\137\141\x63\164\x69\166\x61\x74\145\x64" => ["\162\145\x71\x75\x69\162\145\144"]]); if (!$xVExa->fails()) { goto HKQrc; } return response()->json(["\145\x72\162\x6f\x72\x73" => $xVExa->errors()], 403); goto SOSQv; uo_zl: GHYlS: $zPQ5b->update(["\156\141\x6d\145" => $params["\156\x61\155\x65"], "\144\x65\x73\x63\162\x69\160\164\151\x6f\x6e" => $params["\x64\145\x73\143\162\151\x70\164\x69\157\156"], "\147\162\157\165\x70" => $params["\147\x72\x6f\165\x70"], "\x69\x73\137\141\143\x74\x69\x76\141\164\145\144" => $params["\x69\163\137\141\x63\x74\151\166\x61\164\x65\x64"] === true ? 1 : 0, "\165\x70\144\141\x74\x65\144\x5f\x61\164" => date("\x59\x2d\155\55\x64\x20\110\x3a\151\x3a\163")]); return response()->json(null, 204); goto XjUl0; m3bIU: return response()->json(["\x65\162\162\157\x72\x73" => "\x46\x41\x51\40\x69\163\x20\156\157\164\40\x76\141\154\x69\144"], 403); vcT5h: $params = $request->all(); goto lvMap; XjUl0: } public function tags() { $untsG = Faq::published()->select("\156\141\x6d\145")->get(); return response()->json(["\x64\x61\x74\x61" => $untsG], 200); } public function destroy($uSrWD = 0) { $zPQ5b = Faq::notDeleted()->where("\151\144", $uSrWD)->first(); if (isset($zPQ5b)) { goto lJi0V; } response()->json(["\x65\x72\x72\x6f\162" => "\x45\150\x68\150\41\x20\103\x61\156\40\x6e\x6f\164\x20\144\145\x6c\x65\x74\145\x20\x74\150\x69\x73\40\143\141\164\x65\147\157\x72\171"], 403); lJi0V: try { $zPQ5b->update(["\151\163\x5f\144\x65\x6c\145\164\145\144" => true]); } catch (\Exception $HZFK0) { response()->json(["\145\x72\x72\x6f\162" => $HZFK0->getMessage()], 403); } return response()->json(null, 204); } public function destroyMultiple(Request $request) { goto u4ndE; x63JP: try { Faq::notDeleted()->whereIn("\x69\x64", $K06QR)->update(["\151\x73\137\x64\x65\x6c\145\x74\145\x64" => true]); } catch (\Exception $HZFK0) { response()->json(["\x65\x72\162\157\162" => $HZFK0->getMessage()], 403); } return response()->json(null, 204); goto kHv9c; ukorY: UYXyr: $K06QR = $request->get("\x69\x64\163", []); $xFV1s = Faq::notDeleted()->whereIn("\x69\x64", $K06QR)->get(); goto ICWB4; ICWB4: if (!($xFV1s->count() <= 0)) { goto BSDC6; } response()->json(["\145\x72\x72\x6f\162" => "\x46\x41\x51\40\151\x73\x20\x6e\x6f\164\40\x76\141\x6c\151\x64\56"], 403); BSDC6: goto x63JP; u4ndE: $xVExa = Validator::make($request->all(), ["\x69\x64\x73" => "\x72\145\x71\165\151\x72\145\x64"]); if (!$xVExa->fails()) { goto UYXyr; } return response()->json(["\x65\162\x72\157\162\163" => $xVExa->errors()], 403); goto ukorY; kHv9c: } public function activateMultiple(Request $request) { goto uvzqD; uvzqD: $xVExa = Validator::make($request->all(), ["\x69\x64\163" => "\x72\x65\x71\165\151\x72\145\x64"]); if (!$xVExa->fails()) { goto cFTZS; } return response()->json(["\x65\162\x72\157\162\163" => $xVExa->errors()], 403); goto VHzht; MZ30Q: try { Faq::notDeleted()->whereIn("\x69\144", $K06QR)->update(["\151\x73\137\141\x63\x74\151\x76\x61\x74\x65\x64" => true]); } catch (\Exception $HZFK0) { response()->json(["\145\162\x72\x6f\x72" => $HZFK0->getMessage()], 403); } return response()->json(null, 204); goto GRJHn; VHzht: cFTZS: $K06QR = $request->get("\x69\144\x73", []); $xFV1s = Faq::notDeleted()->whereIn("\151\144", $K06QR)->get(); goto TE7_h; TE7_h: if (!($xFV1s->count() <= 0)) { goto Y83gS; } response()->json(["\x65\162\162\x6f\x72" => "\106\101\x51\40\x69\x73\x20\156\x6f\164\x20\166\x61\x6c\x69\144\x2e"], 403); Y83gS: goto MZ30Q; GRJHn: } public function deactivateMultiple(Request $request) { goto NwdF4; NwdF4: $xVExa = Validator::make($request->all(), ["\151\144\x73" => "\162\145\161\165\151\x72\x65\144"]); if (!$xVExa->fails()) { goto HxMxl; } return response()->json(["\x65\162\162\157\162\163" => $xVExa->errors()], 403); goto tgTt0; pZYkZ: try { Faq::notDeleted()->whereIn("\x69\144", $K06QR)->update(["\x69\x73\x5f\x61\x63\164\151\x76\x61\x74\145\x64" => false]); } catch (\Exception $HZFK0) { response()->json(["\x65\162\x72\x6f\162" => $HZFK0->getMessage()], 403); } return response()->json(null, 204); goto rUnqb; C3Vfs: if (!($xFV1s->count() <= 0)) { goto rUhWJ; } response()->json(["\145\162\x72\157\162" => "\106\x41\121\40\x69\x73\40\x6e\157\x74\x20\x76\x61\x6c\x69\x64\56"], 403); rUhWJ: goto pZYkZ; tgTt0: HxMxl: $K06QR = $request->get("\151\144\x73", []); $xFV1s = Faq::notDeleted()->whereIn("\151\x64", $K06QR)->get(); goto C3Vfs; rUnqb: } }