<?php
//Obfuscated by YAK Pro - Php Obfuscator 2.0.13 at 2025-05-27 11:01:58
 namespace App\Http\Controllers\Admin; use App\EmailTemplateAttachment; use App\Http\Controllers\Controller; use Illuminate\Http\Request; use Illuminate\Support\Arr; use App\ProductReview; use App\Http\Resources\Admin\ProductReviewResource; use Validator; class ReviewController extends Controller { const ITEM_PER_PAGE = 20; public function index(Request $request) { goto wI7cy; U3TPJ: $pAy8Q->where("\x69\163\137\141\143\x74\151\x76\141\164\x65\144", $ThmWg); ZJWLY: $pAy8Q->orderBy("\x69\x64", "\x44\x45\x53\x43"); goto gZiWQ; UDpUK: $pAy8Q->where("\x63\157\155\155\145\x6e\x74", "\114\x49\113\105", "\45" . $ujLR5 . "\x25"); dc02r: if (!($ThmWg != '')) { goto ZJWLY; } goto U3TPJ; gZiWQ: return ProductReviewResource::collection($pAy8Q->paginate($svR1M)); goto BB_Br; wI7cy: $VbJYa = $request->all(); $svR1M = Arr::get($VbJYa, "\x6c\151\155\x69\x74", static::ITEM_PER_PAGE); $ujLR5 = Arr::get($VbJYa, "\153\145\x79\167\x6f\x72\144", ''); goto RuXRl; RuXRl: $ThmWg = Arr::get($VbJYa, "\163\164\x61\x74\165\x73", ''); $pAy8Q = ProductReview::notDeleted()->where("\x70\x61\x72\145\156\164\x5f\151\144", 0); if (empty($ujLR5)) { goto dc02r; } goto UDpUK; BB_Br: } public function all(Request $request) { $VbJYa = $request->all(); $svR1M = Arr::get($VbJYa, "\x6c\151\155\x69\x74", static::ITEM_PER_PAGE); $pAy8Q = ProductReview::select("\52")->notDeleted()->orderBy("\151\144"); return ProductReviewResource::collection($pAy8Q->paginate($svR1M)); } public function show($fnkaW = 0) { $sEr55 = ProductReview::notDeleted()->where("\x69\x64", $fnkaW)->first(); if (isset($sEr55)) { goto lLdmP; } return response()->json(["\145\x72\162\157\x72\163" => "\124\x65\x6d\x70\154\141\x74\145\40\x69\163\x20\156\157\164\40\166\141\154\151\144"], 403); lLdmP: return new ProductReviewResource($sEr55); } public function store(Request $request) { goto tb29z; iVJjE: foreach ($params["\141\x74\164\141\x63\150\155\145\x6e\164\x73"] as $bM0Qp) { $eEN1B[] = ["\145\155\141\x69\x6c\137\164\145\155\160\x6c\x61\164\145\137\151\x64" => $sEr55->id, "\164\x69\164\x6c\x65" => $bM0Qp["\142\x61\x73\145\116\x61\155\x65"], "\146\x69\154\145\x5f\x6e\x61\155\145" => $bM0Qp["\x66\x69\154\x65\x5f\156\x61\x6d\x65"], "\x66\151\x6c\x65\137\164\x79\x70\x65" => $bM0Qp["\x74\171\x70\x65"], "\146\x69\154\x65\x5f\163\x69\x7a\x65" => $bM0Qp["\x73\x69\x7a\145"], "\146\151\154\x65\x5f\145\170\x74\145\156\163\x69\x6f\156" => $bM0Qp["\145\x78\164\x65\x6e\x73\x69\x6f\156"], "\143\x72\145\141\164\145\144\137\141\164" => date("\x59\55\155\x2d\x64\x20\x48\x3a\151\72\163"), "\165\160\144\x61\164\x65\144\x5f\x61\164" => date("\131\x2d\x6d\x2d\144\40\110\x3a\151\x3a\163")]; xpDI1: } M_Pgf: if (!(count($eEN1B) > 0)) { goto o9gHB; } goto zwyL6; heYlO: $sEr55 = ProductReview::create(["\156\x61\155\145" => $params["\156\141\155\x65"], "\x74\x79\160\x65" => $params["\x74\x79\x70\x65"], "\x64\x65\x73\x63\x72\x69\160\164\x69\x6f\x6e" => $params["\144\x65\x73\x63\x72\151\x70\x74\x69\x6f\156"], "\x74\x69\x74\x6c\x65" => $params["\x74\x69\164\154\x65"], "\x63\157\x6e\x74\145\x6e\164" => $params["\143\157\156\x74\x65\156\x74"], "\x67\162\157\x75\160" => $params["\147\x72\x6f\x75\x70"], "\165\163\x65\x72\x5f\151\x64" => auth("\x61\160\x69")->user()->id, "\151\163\x5f\x61\x63\x74\151\166\x61\164\x65\x64" => $params["\151\163\x5f\x61\143\164\151\166\x61\164\x65\144"] === true ? 1 : 0, "\143\x72\x65\x61\164\x65\x64\x5f\141\x74" => date("\x59\x2d\x6d\x2d\x64\x20\110\x3a\x69\x3a\x73"), "\x75\160\144\x61\164\x65\x64\137\141\x74" => date("\131\55\x6d\x2d\144\x20\x48\72\151\x3a\163")]); if (!isset($params["\x61\164\164\141\x63\x68\155\145\x6e\x74\x73"])) { goto jE98O; } $eEN1B = []; goto iVJjE; x1p0p: if (!$UP0J_) { goto R2rrr; } return response()->json(["\x65\162\162\x6f\162\163" => "\x54\x65\155\160\154\x61\x74\x65\x20\x61\x6c\162\145\141\x64\171\x20\x65\x78\151\x73\x74\x73\x2e"], 403); R2rrr: goto heYlO; zwyL6: EmailTemplateAttachment::insert($eEN1B); o9gHB: jE98O: goto SHt80; SHt80: return new ProductReviewResource($sEr55); goto zBGDf; tb29z: $HG9U2 = Validator::make($request->all(), ["\x6e\x61\x6d\x65" => ["\x72\x65\161\165\x69\x72\x65\x64"], "\x74\171\x70\x65" => ["\x72\145\161\x75\151\x72\145\x64"], "\x74\x69\x74\x6c\145" => ["\162\x65\161\x75\151\162\x65\x64"], "\x63\157\156\x74\x65\156\x74" => ["\x72\x65\x71\x75\x69\162\145\144"], "\147\162\157\165\160" => ["\162\145\161\165\x69\x72\145\144"], "\151\x73\x5f\x61\x63\x74\x69\x76\x61\x74\145\144" => ["\x72\x65\161\x75\x69\x72\x65\x64"]]); if (!$HG9U2->fails()) { goto BnRHJ; } return response()->json(["\145\x72\x72\x6f\162\x73" => $HG9U2->errors()], 403); goto FWZKo; FWZKo: BnRHJ: $params = $request->all(); $UP0J_ = ProductReview::notDeleted()->where("\156\141\155\x65", $params["\156\141\155\145"])->first(); goto x1p0p; zBGDf: } public function update(Request $request, $fnkaW = 0) { goto oUPv5; WNno_: $UP0J_ = ProductReview::notDeleted()->where("\151\x64", "\41\x3d", $fnkaW)->where("\156\141\155\x65", $params["\156\141\x6d\145"])->first(); if (!$UP0J_) { goto pmj9E; } return response()->json(["\145\x72\x72\157\162\163" => "\x54\145\155\x70\x6c\141\164\x65\x20\141\x6c\x72\x65\x61\x64\x79\40\x65\x78\151\163\x74\x73\56"], 403); goto ozpZV; ozpZV: pmj9E: $sEr55->update(["\x6e\x61\x6d\145" => $params["\x6e\x61\x6d\x65"], "\x74\171\x70\x65" => $params["\x74\171\x70\145"], "\144\145\x73\x63\x72\151\160\164\151\157\156" => $params["\x64\145\163\143\162\x69\x70\164\151\157\156"], "\164\151\x74\154\x65" => $params["\164\x69\x74\154\x65"], "\143\x6f\156\x74\x65\156\164" => $params["\143\157\x6e\164\x65\156\164"], "\x67\x72\x6f\x75\160" => $params["\147\162\157\165\160"], "\x75\x73\145\x72\x5f\x69\144" => auth("\x61\160\151")->user()->id, "\x69\163\x5f\141\143\164\x69\x76\x61\x74\145\144" => $params["\x69\x73\137\141\x63\x74\151\x76\x61\164\x65\x64"] === true ? 1 : 0, "\x75\x70\144\141\x74\x65\144\x5f\x61\x74" => date("\x59\x2d\155\x2d\144\40\110\72\151\x3a\163")]); if (!isset($params["\141\164\164\141\x63\150\155\145\156\164\163"])) { goto Pywde; } goto XMEzd; XMEzd: EmailTemplateAttachment::where("\145\155\141\151\x6c\x5f\164\145\x6d\x70\x6c\141\x74\x65\x5f\x69\x64", $sEr55->id)->delete(); $eEN1B = []; foreach ($params["\141\x74\164\141\x63\x68\155\145\x6e\x74\163"] as $bM0Qp) { $eEN1B[] = ["\145\155\141\151\154\137\x74\145\x6d\x70\154\x61\164\x65\137\x69\144" => $sEr55->id, "\x74\x69\164\154\x65" => $bM0Qp["\x62\141\x73\145\x4e\141\x6d\145"], "\146\x69\x6c\145\137\156\x61\x6d\145" => $bM0Qp["\x66\x69\154\145\x5f\x6e\x61\x6d\145"], "\146\151\x6c\x65\137\164\171\160\x65" => $bM0Qp["\x74\171\x70\145"], "\x66\x69\154\x65\137\x73\x69\x7a\x65" => $bM0Qp["\163\151\x7a\x65"], "\x66\151\x6c\145\x5f\x65\x78\164\145\x6e\163\x69\x6f\x6e" => $bM0Qp["\145\170\x74\145\x6e\163\x69\x6f\156"], "\x63\162\145\141\164\145\x64\137\141\164" => date("\131\55\155\55\144\x20\110\72\151\x3a\x73"), "\x75\x70\144\141\x74\x65\144\137\141\164" => date("\x59\x2d\155\55\144\40\110\72\151\72\163")]; aUDF0: } goto ZI5oY; oUPv5: $HG9U2 = Validator::make($request->all(), ["\x6e\141\155\145" => ["\162\x65\161\x75\x69\x72\145\x64"], "\x74\x79\x70\145" => ["\162\145\161\165\x69\x72\145\x64"], "\x74\x69\x74\154\145" => ["\x72\145\x71\165\151\x72\145\144"], "\x63\157\156\164\x65\156\164" => ["\162\145\161\165\151\162\x65\144"], "\x67\162\157\165\x70" => ["\x72\145\161\165\x69\162\145\x64"], "\151\163\x5f\x61\x63\164\x69\166\x61\x74\x65\x64" => ["\x72\145\x71\165\x69\162\145\144"]]); if (!$HG9U2->fails()) { goto bMPe4; } return response()->json(["\145\x72\162\157\x72\163" => $HG9U2->errors()], 403); goto caUDq; h906J: return response()->json(["\x65\x72\x72\157\x72\x73" => "\124\145\x6d\160\154\141\164\145\x20\151\x73\40\156\x6f\164\40\166\x61\x6c\x69\x64"], 403); vbEjR: $params = $request->all(); goto WNno_; caUDq: bMPe4: $sEr55 = ProductReview::notDeleted()->where("\x69\144", $fnkaW)->first(); if (isset($sEr55)) { goto vbEjR; } goto h906J; kgYxo: ZLB39: Pywde: return response()->json(null, 204); goto kfKNi; ZI5oY: Udqz7: if (!(count($eEN1B) > 0)) { goto ZLB39; } EmailTemplateAttachment::insert($eEN1B); goto kgYxo; kfKNi: } public function destroy($fnkaW = 0) { $sEr55 = ProductReview::notDeleted()->where("\x69\x64", $fnkaW)->first(); if (isset($sEr55)) { goto siPBx; } response()->json(["\145\162\162\x6f\x72" => "\105\x68\x68\150\41\40\103\141\x6e\x20\156\157\x74\x20\144\145\154\x65\164\x65\x20\x74\150\x69\x73\x20\x74\x65\155\x70\154\141\164\x65"], 403); siPBx: try { $sEr55->update(["\151\x73\x5f\x64\145\x6c\x65\164\x65\x64" => true, "\x75\160\x64\141\x74\145\x64\137\141\x74" => date("\131\x2d\x6d\x2d\144\x20\110\72\151\72\163")]); } catch (\Exception $fTubp) { response()->json(["\x65\162\162\157\x72" => $fTubp->getMessage()], 403); } return response()->json(null, 204); } public function destroyMultiple(Request $request) { goto SoqPr; zTR3a: ClUJv: $fY0zv = $request->get("\x69\144\x73", []); $Canhs = ProductReview::notDeleted()->whereIn("\x69\144", $fY0zv)->get(); goto Xj4TF; SoqPr: $HG9U2 = Validator::make($request->all(), ["\151\144\163" => "\x72\x65\161\x75\151\x72\145\x64"]); if (!$HG9U2->fails()) { goto ClUJv; } return response()->json(["\145\162\162\157\162\x73" => $HG9U2->errors()], 403); goto zTR3a; gWWa_: try { ProductReview::notDeleted()->whereIn("\x69\144", $fY0zv)->update(["\x69\163\x5f\144\145\154\x65\x74\x65\x64" => true, "\x75\x70\144\141\x74\145\144\x5f\x61\164" => date("\131\55\155\x2d\x64\40\x48\72\x69\72\163")]); } catch (\Exception $fTubp) { response()->json(["\x65\162\x72\x6f\162" => $fTubp->getMessage()], 403); } return response()->json(null, 204); goto Xk6e9; Xj4TF: if (!($Canhs->count() <= 0)) { goto Q44Jv; } response()->json(["\145\x72\162\157\162" => "\124\145\155\160\154\141\164\x65\40\x69\163\40\156\157\164\x20\166\141\x6c\151\x64\56"], 403); Q44Jv: goto gWWa_; Xk6e9: } public function activateMultiple(Request $request) { goto CK5No; MuguE: UEjpC: $fY0zv = $request->get("\x69\x64\x73", []); $Canhs = ProductReview::notDeleted()->whereIn("\x69\x64", $fY0zv)->get(); goto ZPA1N; ZPA1N: if (!($Canhs->count() <= 0)) { goto qk_0R; } response()->json(["\x65\x72\x72\157\x72" => "\x54\145\x6d\160\154\141\164\x65\40\x69\163\x20\156\157\164\40\166\141\x6c\x69\x64\x2e"], 403); qk_0R: goto MAorS; CK5No: $HG9U2 = Validator::make($request->all(), ["\x69\144\163" => "\162\x65\x71\165\x69\162\x65\x64"]); if (!$HG9U2->fails()) { goto UEjpC; } return response()->json(["\x65\x72\x72\157\x72\x73" => $HG9U2->errors()], 403); goto MuguE; MAorS: try { ProductReview::notDeleted()->whereIn("\x69\x64", $fY0zv)->update(["\x69\x73\137\141\143\164\x69\x76\141\x74\145\144" => true, "\x75\x70\144\141\x74\x65\144\x5f\141\x74" => date("\131\x2d\x6d\x2d\144\x20\110\x3a\x69\72\163")]); } catch (\Exception $fTubp) { response()->json(["\145\x72\162\157\162" => $fTubp->getMessage()], 403); } return response()->json(null, 204); goto Yc8Tq; Yc8Tq: } public function deactivateMultiple(Request $request) { goto xpj_e; rjirW: try { ProductReview::notDeleted()->whereIn("\151\x64", $fY0zv)->update(["\x69\163\x5f\141\x63\x74\151\166\141\164\x65\x64" => false, "\x75\x70\x64\141\x74\x65\144\137\141\x74" => date("\x59\55\155\x2d\x64\x20\110\x3a\x69\72\163")]); } catch (\Exception $fTubp) { response()->json(["\145\x72\x72\x6f\162" => $fTubp->getMessage()], 403); } return response()->json(null, 204); goto zKvgQ; HaMe8: if (!($Canhs->count() <= 0)) { goto xUPhh; } response()->json(["\x65\162\x72\157\x72" => "\124\145\x6d\x70\154\x61\164\145\40\x69\x73\40\x6e\x6f\x74\40\x76\x61\x6c\x69\x64\56"], 403); xUPhh: goto rjirW; xpj_e: $HG9U2 = Validator::make($request->all(), ["\x69\144\x73" => "\x72\145\x71\x75\151\162\x65\144"]); if (!$HG9U2->fails()) { goto RvSDt; } return response()->json(["\x65\x72\162\x6f\162\x73" => $HG9U2->errors()], 403); goto ZBISz; ZBISz: RvSDt: $fY0zv = $request->get("\x69\144\163", []); $Canhs = ProductReview::notDeleted()->whereIn("\x69\x64", $fY0zv)->get(); goto HaMe8; zKvgQ: } }