<?php
//Obfuscated by YAK Pro - Php Obfuscator 2.0.13 at 2025-05-27 11:01:59
 namespace App\Http\Controllers\Admin; use App\Http\Controllers\Controller; use Illuminate\Http\Request; use Illuminate\Support\Arr; use App\Http\Resources\Admin\WhatNewResource; use App\WhatNew; use App\Article; use Validator; class WhatNewController extends Controller { const ITEM_PER_PAGE = 100; public function index(Request $request) { goto TYRFA; ZS8MS: $JJ1LR = Arr::get($hq9ph, "\x61\162\x74\x69\143\x6c\145\137\x69\144", ''); $rNu0g = Arr::get($hq9ph, "\153\145\171\167\157\x72\144", ''); $KyvBV = WhatNew::where("\x74\171\160\x65", $ZNVNA); goto m01jL; m01jL: if (empty($JJ1LR)) { goto cz6N3; } $KyvBV->where("\x61\162\x74\x69\x63\154\x65\137\x69\x64", $JJ1LR); cz6N3: goto qERKc; qERKc: if (empty($rNu0g)) { goto s2OG7; } $hD4FX = Article::where("\x74\x69\x74\154\x65", "\x4c\111\x4b\x45", "\45" . $rNu0g . "\x25")->pluck("\151\x64")->toArray(); $KyvBV->whereIn("\141\162\164\x69\x63\x6c\145\x5f\x69\144", $hD4FX); goto MhwMq; TYRFA: $hq9ph = $request->all(); $TSszq = Arr::get($hq9ph, "\x6c\x69\155\x69\x74", static::ITEM_PER_PAGE); $ZNVNA = Arr::get($hq9ph, "\x74\171\x70\145", 0); goto ZS8MS; MhwMq: s2OG7: $KyvBV->orderBy("\160\x6f\163\x69\164\151\x6f\156")->orderBy("\151\x64"); return WhatNewResource::collection($KyvBV->paginate($TSszq)); goto Eeqbu; Eeqbu: } public function all(Request $request) { $hq9ph = $request->all(); $TSszq = Arr::get($hq9ph, "\154\x69\x6d\x69\164", static::ITEM_PER_PAGE); $KyvBV = WhatNew::select("\x2a")->orderBy("\160\x6f\163\x69\164\x69\x6f\156")->orderBy("\x69\x64"); return WhatNewResource::collection($KyvBV->paginate($TSszq)); } public function available(Request $request) { goto pir4U; a3Cmw: $KyvBV->where("\x69\144", "\41\75", $tfxVL); fwnzb: $KyvBV->orderBy("\x70\157\163\151\x74\151\157\156")->orderBy("\151\144"); goto gpQKq; gpQKq: return WhatNewResource::collection($KyvBV->get()); goto EjNx4; pir4U: $tfxVL = Arr::get($request->all(), "\x69\x67\156\x6f\x72\x65\111\144", ''); $KyvBV = WhatNew::select("\52"); if (!($tfxVL != null && $tfxVL != '')) { goto fwnzb; } goto a3Cmw; EjNx4: } public function show($ytfug = 0) { $AvQcd = WhatNew::where("\x69\144", $ytfug)->first(); if (isset($AvQcd)) { goto otUwa; } return response()->json(["\x65\x72\162\157\x72\163" => "\x41\x72\x74\x69\143\x6c\145\40\151\x73\40\x6e\157\164\x20\166\x61\x6c\x69\144"], 403); otUwa: return new WhatNewResource($AvQcd); } public function store(Request $request) { goto t2zlg; rWR5H: W_5ij: $params = $request->all(); $ZNVNA = Arr::get($params, "\x74\x79\160\x65", 0); goto DrsD7; u5reP: return response()->json(["\163\164\x61\x74\x75\x73" => "\x73\165\x63\x63\x65\163\x73"], 200); goto Ht7Z7; DrsD7: $hD4FX = Arr::get($params, "\x61\x72\x74\x69\143\154\145\163", []); $XgEJA = WhatNew::where("\x74\171\160\145", $ZNVNA)->orderBy("\151\144", "\104\x45\123\103")->first(); $mdkNQ = isset($XgEJA) ? $XgEJA->position : 0; goto xPXwR; xPXwR: $tesi0 = []; foreach ($hD4FX as $JJ1LR) { goto UOxZL; Wcgoo: xVNSe: goto k2Iqp; UOxZL: $mdkNQ++; $aobII = WhatNew::where("\x74\x79\x70\x65", $ZNVNA)->where("\141\x72\x74\x69\143\x6c\x65\x5f\x69\x64", $JJ1LR)->count(); if (!($aobII <= 0)) { goto rXdE7; } goto Bsu0L; Bsu0L: $AvQcd = Article::where("\x69\x73\x5f\144\x65\154\x65\164\x65\x64", false)->where("\x69\x64", $JJ1LR)->first(); $tesi0[] = ["\x74\x79\x70\x65" => $ZNVNA, "\x61\162\164\x69\x63\x6c\145\137\151\144" => $AvQcd->id, "\x70\x6f\x73\x69\164\151\157\156" => $mdkNQ, "\143\x72\x65\x61\x74\145\144\x5f\x61\164" => date("\x59\55\x6d\x2d\x64\40\x48\x3a\x69\x3a\163"), "\x75\160\x64\x61\x74\x65\x64\137\141\x74" => date("\x59\x2d\155\x2d\x64\40\110\x3a\x69\72\163")]; rXdE7: goto Wcgoo; k2Iqp: } JxcoR: goto Ljcn3; t2zlg: $YdnQl = Validator::make($request->all(), ["\x74\x79\x70\145" => ["\x72\x65\x71\165\151\162\x65\144"], "\141\162\x74\x69\x63\x6c\145\163" => ["\162\145\161\165\x69\162\145\144"]]); if (!$YdnQl->fails()) { goto W_5ij; } return response()->json(["\145\162\x72\157\162\163" => $YdnQl->errors()], 403); goto rWR5H; Ljcn3: if (!(count($tesi0) > 0)) { goto x7P49; } WhatNew::insert($tesi0); x7P49: goto u5reP; Ht7Z7: } public function update(Request $request, $ytfug = 0) { goto nKG4k; nKG4k: $YdnQl = Validator::make($request->all(), ["\156\x61\x6d\145" => ["\x72\x65\x71\165\x69\x72\x65\x64"], "\151\x73\137\141\143\164\151\x76\x61\x74\x65\x64" => ["\162\x65\x71\x75\x69\162\145\x64"]]); if (!$YdnQl->fails()) { goto k8Rbv; } return response()->json(["\x65\162\162\x6f\162\x73" => $YdnQl->errors()], 403); goto dG6wU; dG6wU: k8Rbv: $gFDYt = WhatNew::where("\151\x64", $ytfug)->first(); if (isset($AvQcd)) { goto JWj2R; } goto Pogzc; Pogzc: return response()->json(["\x65\x72\162\x6f\162\163" => "\x41\x72\x74\x69\x63\x6c\145\x20\151\163\x20\156\x6f\x74\40\166\141\x6c\x69\x64"], 403); JWj2R: $params = $request->all(); goto QGtLj; QGtLj: $gFDYt->update(["\164\171\160\x65" => 0, "\141\x72\164\151\x63\154\145\137\151\x64" => null, "\x70\x6f\x73\x69\x74\x69\157\156" => 0, "\x69\163\137\141\x63\x74\151\166\x61\164\145\144" => $params["\151\163\x5f\x61\143\164\151\x76\x61\x74\x65\x64"] === true ? 1 : 0, "\165\x70\x64\141\x74\x65\x64\137\x61\x74" => date("\131\x2d\155\55\144\x20\x48\72\x69\72\163")]); return response()->json(null, 204); goto cKQda; cKQda: } public function destroy($ytfug = 0) { $AvQcd = WhatNew::where("\151\144", $ytfug)->first(); if (isset($AvQcd)) { goto XGIxG; } response()->json(["\x65\x72\x72\157\x72" => "\105\x68\x68\x68\41\x20\103\141\156\40\156\x6f\164\40\x64\145\154\145\x74\x65\x20\x74\150\151\x73\x20\141\162\164\151\x63\x6c\145"], 403); XGIxG: try { $AvQcd->delete(); } catch (\Exception $bvJ0i) { response()->json(["\x65\x72\162\157\x72" => $bvJ0i->getMessage()], 403); } return response()->json(null, 204); } public function destroyMultiple(Request $request) { goto CagW3; aKn2r: try { WhatNew::whereIn("\x69\x64", $JQLON)->delete(); } catch (\Exception $bvJ0i) { response()->json(["\145\x72\162\157\162" => $bvJ0i->getMessage()], 403); } return response()->json(null, 204); goto Qnk5U; Qt7B3: if (!($uFrlm->count() <= 0)) { goto tDmIR; } response()->json(["\145\x72\162\x6f\x72" => "\x41\162\164\151\x63\154\145\40\151\x73\x20\x6e\157\164\x20\166\x61\x6c\x69\x64\56"], 403); tDmIR: goto aKn2r; CagW3: $YdnQl = Validator::make($request->all(), ["\151\x64\x73" => "\x72\145\161\x75\x69\162\145\x64"]); if (!$YdnQl->fails()) { goto xhsK4; } return response()->json(["\x65\162\x72\157\x72\x73" => $YdnQl->errors()], 403); goto CW1Kg; CW1Kg: xhsK4: $JQLON = $request->get("\151\144\163", []); $uFrlm = WhatNew::whereIn("\151\144", $JQLON)->get(); goto Qt7B3; Qnk5U: } public function activateMultiple(Request $request) { goto dZyKi; xSqqV: o7yQC: $JQLON = $request->get("\151\x64\163", []); $uFrlm = WhatNew::whereIn("\x69\x64", $JQLON)->get(); goto wW092; wW092: if (!($uFrlm->count() <= 0)) { goto H9rdp; } response()->json(["\145\x72\162\157\x72" => "\x41\162\x74\x69\x63\x6c\x65\40\151\x73\x20\x6e\x6f\164\x20\166\141\154\151\144\x2e"], 403); H9rdp: goto Idn0y; dZyKi: $YdnQl = Validator::make($request->all(), ["\x69\x64\x73" => "\162\x65\161\x75\151\x72\145\144"]); if (!$YdnQl->fails()) { goto o7yQC; } return response()->json(["\x65\x72\x72\x6f\x72\163" => $YdnQl->errors()], 403); goto xSqqV; Idn0y: try { WhatNew::whereIn("\x69\x64", $JQLON)->update(["\151\163\137\141\143\164\151\166\x61\164\145\x64" => true]); } catch (\Exception $bvJ0i) { response()->json(["\x65\162\x72\157\162" => $bvJ0i->getMessage()], 403); } return response()->json(null, 204); goto pWmmu; pWmmu: } public function deactivateMultiple(Request $request) { goto aPygA; in7Yg: Gr69o: $JQLON = $request->get("\151\144\163", []); $uFrlm = WhatNew::whereIn("\x69\144", $JQLON)->get(); goto y7xwX; y7xwX: if (!($uFrlm->count() <= 0)) { goto m_GfC; } response()->json(["\145\162\x72\x6f\162" => "\101\162\164\151\143\154\145\x20\151\x73\40\156\x6f\164\x20\x76\141\x6c\x69\144\56"], 403); m_GfC: goto aHbN5; aPygA: $YdnQl = Validator::make($request->all(), ["\151\144\163" => "\x72\x65\x71\x75\151\x72\145\x64"]); if (!$YdnQl->fails()) { goto Gr69o; } return response()->json(["\145\162\162\157\162\x73" => $YdnQl->errors()], 403); goto in7Yg; aHbN5: try { WhatNew::whereIn("\151\x64", $JQLON)->update(["\151\x73\137\141\143\164\151\166\x61\164\145\x64" => false]); } catch (\Exception $bvJ0i) { response()->json(["\x65\x72\x72\x6f\162" => $bvJ0i->getMessage()], 403); } return response()->json(null, 204); goto VimEh; VimEh: } public function position(Request $request) { goto ivyWd; ivyWd: if ($request->has("\x70\157\163\x69\164\151\157\156")) { goto dSBtV; } return response()->json(["\x65\x72\162\157\x72\163" => "\104\x61\164\x61\40\151\x73\40\x69\156\x76\x61\154\x69\x64"], 403); dSBtV: goto il1b3; v3dfF: zm5qO: tlKlg: return response()->json(null, 204); goto xLF4d; il1b3: $WYp3l = $request->position; if (!is_array($WYp3l)) { goto tlKlg; } foreach ($WYp3l as $MvsZA) { WhatNew::where("\151\x64", $MvsZA["\x69\x64"])->update(["\x70\157\x73\x69\x74\x69\157\156" => $MvsZA["\x6f\x72\144\145\162"]]); aGGq8: } goto v3dfF; xLF4d: } }