<?php
//Obfuscated by YAK Pro - Php Obfuscator 2.0.13 at 2025-05-27 11:01:55
 namespace App\Http\Controllers\Admin; use App\Events\SaveDataEvent; use App\Helpers\Helper; use App\Http\Controllers\Controller; use Illuminate\Http\Request; use Illuminate\Support\Arr; use App\Media; use App\Http\Resources\Admin\MediaResource; use Intervention\Image\Exception\NotReadableException; use Validator; use ImageCross; class MediaController extends Controller { const ITEM_PER_PAGE = 20; private $_filePath; public function __construct() { $this->_filePath = public_path("\165\160\154\x6f\x61\x64\x73\57\146\x69\154\x65\163\x2f"); } public function index(Request $request) { goto f86OT; HqoL3: return MediaResource::collection($ApNlt->paginate($Ia9JB)); goto X4Jn2; f86OT: $ojE7y = $request->all(); $Ia9JB = Arr::get($ojE7y, "\154\151\x6d\151\164", static::ITEM_PER_PAGE); $k90ik = Arr::get($ojE7y, "\x70\x61\162\145\156\164\x5f\x69\x64", 0); goto TaDw0; bTITH: $ApNlt->where("\x6e\141\x6d\x65", "\114\x49\x4b\105", "\x25" . $MaCLU . "\x25"); ZOH3N: $ApNlt->orderBy("\x74\171\x70\x65")->orderBy("\143\162\145\x61\164\x65\x64\137\141\164"); goto HqoL3; TaDw0: $MaCLU = Arr::get($ojE7y, "\153\x65\x79\x77\x6f\x72\144", ''); $ApNlt = Media::notDeleted()->where("\160\141\162\145\x6e\x74\x5f\x69\x64", $k90ik); if (!($MaCLU != null && $MaCLU != '')) { goto ZOH3N; } goto bTITH; X4Jn2: } public function show($SIsJi = 0) { } public function store(Request $request) { goto z6UJ1; JAioC: $k90ik = trim($params["\160\141\162\145\156\x74\137\x69\144"]); $k90ik = $k90ik != null && $k90ik != '' ? $k90ik : 0; if (!($k90ik != 0 && $k90ik != "\x30")) { goto bYUfa; } goto SEXx_; ZYxKE: o8SeU: bYUfa: $m0nb1 = Media::where("\151\163\x5f\x64\145\x6c\145\164\145\x64", 0)->where("\164\171\160\x65", 0)->where("\160\141\x72\x65\x6e\x74\137\151\x64", $k90ik)->where("\x6e\x61\x6d\x65", $mzaop)->count(); goto vQqRZ; vQqRZ: if (!($m0nb1 > 0)) { goto K3bbu; } return response()->json(["\x73\x74\x61\164\165\x73" => "\x65\x72\x72\157\162", "\155\x65\163\163\141\x67\x65" => "\101\x20\146\157\x6c\144\145\x72\40\167\x69\x74\x68\40\164\150\141\164\x20\x6e\x61\155\x65\x20\141\154\x72\x65\141\144\171\x20\145\x78\151\x73\x74\x73\x2e"], 200); K3bbu: goto m5JDq; zWy80: DaJ_O: $params = $request->all(); $mzaop = trim($params["\x6e\x61\x6d\x65"]); goto JAioC; YwDgu: $jBkDh = str_replace("\137", "\55", $jBkDh); $KIV4W = md5($mzaop . rand(1111, 9999) . rand(1111, 9999) . date("\x59\155\x64\x48\x69\x73")); $mQVR5 = Media::create(["\x6e\141\x6d\x65" => $mzaop, "\x73\x6c\x75\147" => $jBkDh, "\x66\x69\x6c\145" => $KIV4W, "\164\x79\160\x65" => 0, "\x70\x61\162\145\x6e\164\137\151\144" => $k90ik, "\x63\162\145\x61\x74\x65\x64\137\x61\x74" => date("\x59\55\155\x2d\144\40\x48\72\x69\72\163"), "\165\x70\x64\141\x74\x65\x64\x5f\x61\164" => date("\x59\55\155\x2d\x64\x20\x48\x3a\151\72\163")]); goto L1qLt; m5JDq: $jBkDh = str_replace("\56", '', $mzaop); $jBkDh = Helper::slug($jBkDh); $jBkDh = str_replace("\x2d\55", "\55", $jBkDh); goto YwDgu; z6UJ1: $flTEc = Validator::make($request->all(), ["\x6e\x61\155\145" => ["\162\x65\x71\165\151\x72\x65\x64"]]); if (!$flTEc->fails()) { goto DaJ_O; } return response()->json(["\163\164\141\x74\165\x73" => "\145\x72\162\x6f\x72", "\x65\x72\162\157\x72\x73" => $flTEc->errors(), "\x6d\145\163\x73\141\x67\x65" => $flTEc->errors()], 403); goto zWy80; SEXx_: $sfo33 = Media::where("\151\x73\x5f\x64\145\154\x65\x74\x65\x64", 0)->where("\x74\171\x70\145", 0)->where("\x69\144", $k90ik)->count(); if (!($sfo33 <= 0)) { goto o8SeU; } return response()->json(["\163\164\141\x74\x75\x73" => "\x65\162\162\x6f\162", "\155\145\x73\163\x61\x67\145" => "\x50\x61\x72\145\x6e\164\40\x66\157\154\144\145\x72\40\x6e\157\164\40\x66\x6f\165\156\x64\x2e"], 200); goto ZYxKE; L1qLt: $SWwp7 = new MediaResource($mQVR5); event(new SaveDataEvent()); return response()->json(["\x73\x74\x61\164\x75\163" => "\x73\x75\143\143\x65\x73\x73", "\155\145\x73\163\x61\x67\145" => "\123\165\x63\143\x65\163\163", "\151\164\x65\x6d" => $SWwp7], 200); goto MN10Q; MN10Q: } public function update($SIsJi = 0, Request $request) { } public function destroy($SIsJi = 0) { } public function destroyMultiple(Request $request) { } public function uploadFile(Request $request) { goto q73pU; UZUcF: $fcEKH = Media::where("\151\163\x5f\x64\145\154\145\x74\x65\x64", false)->where("\164\171\160\x65", 0)->where("\156\x61\155\x65", trim($request->get("\x66\x6f\154\x64\x65\162")))->where("\x70\x61\x72\145\x6e\x74\x5f\151\144", 0)->first(); if (!(!isset($fcEKH) || $fcEKH == null)) { goto AfEkb; } $fcEKH = Media::create(["\156\x61\x6d\x65" => trim($request->get("\146\157\154\144\145\162")), "\163\154\165\147" => Helper::slug($request->get("\x66\157\x6c\144\x65\162")), "\x66\151\x6c\x65" => md5(rand(1000, 100000) . $request->get("\x66\x6f\x6c\144\145\162") . date("\x59\x6d\144\x48\x69\x73")), "\x74\x79\x70\x65" => 0, "\160\141\162\x65\156\x74\x5f\151\x64" => 0, "\x63\x72\145\x61\x74\x65\x64\x5f\141\164" => date("\131\55\x6d\55\144\40\110\x3a\x69\72\x73"), "\x75\160\x64\x61\x74\x65\x64\x5f\x61\x74" => date("\x59\x2d\155\55\144\x20\x48\x3a\x69\72\x73")]); goto TkWM6; tVPBa: $k90ik = $Vknht != null && $Vknht != '' && $Vknht != "\156\165\154\x6c" && !empty($Vknht) ? $Vknht : 0; $Mh8kP = $XD9qj->getClientOriginalName(); $j8f9W = ["\x69\x6d\x61\x67\x65\57\152\x70\145\147", "\x69\155\141\x67\x65\57\160\x6e\x67", "\151\155\x61\x67\145\x2f\152\160\147", "\x69\155\x61\147\145\x2f\x67\151\x66", "\151\155\141\x67\x65\57\167\145\142\x70"]; goto P1eV2; P1eV2: $OV9Oj = ["\163\164\x61\164\165\163" => "\x65\162\x72\157\x72", "\x6d\x65\163\163\x61\x67\x65" => "\125\160\154\x6f\141\x64\x20\106\141\x69\x6c\56", "\x66\x69\x6c\145\137\156\x61\x6d\x65" => null, "\x62\x61\163\145\116\x61\155\x65" => $Mh8kP, "\151\164\x65\x6d" => null]; $n7fSv = 403; try { goto psoP9; yu8rI: $fXyy3 = str_replace("\56" . $x9PyU . $RVWxp, '', $Mh8kP . $RVWxp); ugT4l: if (!($m0nb1 > 0)) { goto qeRKq; } goto M2yus; wPza6: try { $L_o6f = ImageCross::make($this->_filePath . $KIV4W)->orientate(); $mQVR5->update(["\167\151\x64\x74\x68" => $L_o6f->width(), "\x68\145\x69\147\x68\x74" => $L_o6f->height()]); Helper::convertJpgToWebp($KIV4W); } catch (NotReadableException $Ma2Od) { logger("\x5b\105\x72\162\x6f\x72\x5d\40\111\155\141\x67\x65\40\x43\162\157\163\163\x3a\x20" . $Ma2Od->getMessage()); } catch (\Exception $Ma2Od) { logger("\133\x45\162\162\x6f\162\135\40\111\x6d\x61\147\145\x20\x43\x72\157\163\x73\x3a\x20" . $Ma2Od->getMessage()); } R7mms: $SWwp7 = new MediaResource($mQVR5); goto fb1Mz; b5eWR: $RVWxp = "\x32\x32\63\x33\64\x34"; $Ket37 = 0; $m0nb1 = Media::where("\x69\x73\137\x64\x65\154\145\164\x65\x64", 0)->where("\x70\x61\162\145\x6e\164\x5f\151\x64", $k90ik)->where("\x6e\x61\x6d\145", $Mh8kP)->count(); goto yu8rI; fb1Mz: $OV9Oj = ["\163\x74\x61\x74\165\x73" => "\x73\165\x63\143\x65\x73\163", "\155\x65\163\163\x61\147\x65" => "\x55\160\x6c\157\141\144\40\123\165\143\143\145\163\163\56", "\146\151\x6c\x65\137\156\141\x6d\x65" => $KIV4W, "\x62\141\163\145\x4e\141\x6d\145" => $Mh8kP, "\151\164\145\155" => $SWwp7]; $n7fSv = 200; event(new SaveDataEvent()); goto tacnn; psoP9: $x9PyU = $XD9qj->getClientOriginalExtension(); $ZAlu8 = $XD9qj->getMimeType(); $Yt4TI = $this->formatBytes($XD9qj->getSize()); goto A4JD8; axVH2: $jBkDh = str_replace("\x5f", "\55", $jBkDh); $mQVR5 = Media::create(["\x6e\141\x6d\x65" => $Mh8kP, "\x73\x6c\x75\x67" => $jBkDh, "\146\x69\x6c\145" => $KIV4W, "\146\x69\x6c\145\137\x74\171\160\x65" => $ZAlu8, "\x65\170\164\145\x6e\x73\x69\x6f\x6e" => "\56" . $x9PyU, "\163\x69\172\x65" => $Yt4TI, "\164\171\160\x65" => 1, "\x70\x61\162\145\x6e\x74\x5f\151\144" => $k90ik, "\x63\162\145\x61\x74\145\144\137\x61\x74" => date("\x59\55\x6d\55\x64\40\110\72\x69\72\x73"), "\x75\160\144\x61\x74\145\x64\137\x61\164" => date("\x59\55\x6d\x2d\x64\40\110\x3a\151\x3a\163")]); if (!in_array($ZAlu8, $j8f9W)) { goto R7mms; } goto wPza6; yBP0K: goto ugT4l; qeRKq: $jBkDh = str_replace("\x29\x2e" . $x9PyU . $RVWxp, '', $Mh8kP . $RVWxp); goto s00kx; yiEa7: if ($pNOow > 0) { goto oP56v; } EUeOA: $XD9qj->move($this->_filePath, $KIV4W); goto b5eWR; B6eUY: $jBkDh = str_replace("\x29", '', $jBkDh); $jBkDh = Helper::slug($jBkDh); $jBkDh = str_replace("\x2d\55", "\55", $jBkDh); goto axVH2; A4JD8: oP56v: $KIV4W = md5($Mh8kP . rand(1111, 9999) . date("\x59\155\144\x48\151\x73")) . "\56" . $x9PyU; $pNOow = Media::where("\x69\163\137\144\145\x6c\x65\x74\145\x64", 0)->where("\146\151\154\x65", $KIV4W)->count(); goto yiEa7; M2yus: $Ket37 += 1; $Mh8kP = $fXyy3 . "\x20\x28" . $Ket37 . "\x29\56" . $x9PyU; $m0nb1 = Media::where("\151\x73\x5f\144\145\x6c\x65\x74\x65\x64", 0)->where("\160\x61\162\x65\x6e\x74\x5f\x69\144", $k90ik)->where("\x6e\x61\x6d\145", $Mh8kP)->count(); goto yBP0K; s00kx: $jBkDh = str_replace("\x2e" . $x9PyU . $RVWxp, '', $jBkDh); $jBkDh = str_replace("\x2e", '', $jBkDh); $jBkDh = str_replace("\50", "\x2d", $jBkDh); goto B6eUY; tacnn: } catch (\Exception $Ma2Od) { logger("\133\105\x72\162\x6f\x72\135\x20\125\160\x6c\x6f\141\144\x20\146\x69\154\145\72\40" . $Ma2Od->getMessage()); } finally { return response()->json($OV9Oj, $n7fSv); } goto MeoOJ; q73pU: if ($request->hasFile("\146\x69\154\x65")) { goto yjkiM; } return response()->json(["\163\x74\141\164\x75\163" => "\x65\x72\x72\x6f\162", "\x6d\x65\x73\x73\141\x67\145" => "\x55\160\x6c\x6f\141\144\x20\x46\141\x69\x6c\x2e", "\146\151\154\145\x5f\x6e\141\x6d\x65" => null], 403); yjkiM: goto GYC4s; GYC4s: $XD9qj = $request->file("\146\x69\154\145"); $Vknht = trim($request->get("\x70\x61\x72\145\x6e\164")); if (!(($Vknht == null || $Vknht == '' || $Vknht == "\x6e\165\x6c\x6c") && $request->has("\146\x6f\x6c\144\145\x72") && $request->get("\x66\x6f\154\144\145\162") != null && $request->get("\x66\157\x6c\144\x65\x72") != '' && $request->get("\146\x6f\x6c\x64\x65\162") != "\x6e\165\154\x6c")) { goto PB8Wv; } goto UZUcF; TkWM6: AfEkb: $Vknht = $fcEKH->id; PB8Wv: goto tVPBa; MeoOJ: } private function formatBytes($ZppFU, $o2fhV = 2) { $ECp97 = array("\x42", "\113\x62", "\115\x42", "\107\x42", "\124\102"); $ZppFU = max($ZppFU, 0); $FB7Ol = floor(($ZppFU ? log($ZppFU) : 0) / log(1024)); $FB7Ol = min($FB7Ol, count($ECp97) - 1); $ZppFU /= pow(1024, $FB7Ol); return round($ZppFU, $o2fhV) . '' . $ECp97[$FB7Ol]; } private function generateThumb($KIV4W, $TjdNr, $Wt0nu) { if (!file_exists($this->_filePath . $KIV4W)) { goto iZoB6; } $L_o6f = ImageCross::make($this->_filePath . $KIV4W)->orientate(); $L_o6f->fit($TjdNr, $Wt0nu, function ($iLHho) { $iLHho->upsize(); })->save($this->_filePath . "\x6e\145\167\137" . $KIV4W); iZoB6: } }