���Root Mod By V1rus_Alfa
User / IP
:
216.73.217.78
Host / Server
:
195.214.235.115 / npln.ir
System
:
Linux damavand.pws-dns.net 5.14.0-503.35.1.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Apr 4 05:23:43 EDT 2025 x86_64
Command
|
Upload
|
Mass Deface
|
Create
:
/
home2
/
cutunixc
/
repositories
/
cutunix
/
app
/
Helpers
/
Viewing: imageHelperApi.php
<?php namespace App\Helpers; use Carbon\Carbon; use Intervention\Image\Facades\Image; use Illuminate\Support\Facades\Storage; use App\Models\Files; if (!function_exists('imageHelperApi')) { function imageHelperApi($fileRequest,$filesystem,$water='ok',$width='',$height='',$path='',$save=false,$id='',$model=''){ $file=$fileRequest; $rand=rand(10000,99999); //get the base-64 from data $base64_str = substr($file, strpos($file, ",")+1); //decode base64 string $image = base64_decode($base64_str); if($width){ $img = Image::make($image)->resize($width, $height);; }else{ $img = Image::make($image); } if ($water == 'ok') { // $img->insert(public_path('image/waterMark.png'), 'bottom-left', 5, 5); } if($path){ $img->save($path); $response=$path; }else{ $year=Carbon::now()->year; $month=Carbon::now()->month; $day=Carbon::now()->day; $imagePath="upload/images/{$year}/{$month}/{$day}/"; if (!$filesystem->exists("{$imagePath}")){ mkdir($imagePath, 0777, true); } $mime = explode(",",$file)[0]; switch ($mime) {//check image's extension case "data:image/jpeg;base64": $mime = "jpeg"; break; case "data:image/png;base64": $mime = "png"; break; default://should write cases for more images types $mime = "jpg"; break; } $filename=Carbon::now()->timestamp.rand(10000,99999).'.'.$mime; $img->save($imagePath.$filename); $response='/'.$imagePath.$filename; } if($save == true){ Files::create([ 'name'=>$filename, 'address'=>$response, 'type'=>'image', 'size'=>$width .'*'.$height, 'table'=>$model, 'row_id'=>$id, ]); } return $response; } }
Coded With 💗 by
0x6ick Mod By V1rus_Alfa