⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.13
Server IP:
109.199.105.153
Server:
Linux connect.inboxifs.com 5.15.0-152-generic #162-Ubuntu SMP Wed Jul 23 09:48:42 UTC 2025 x86_64
Server Software:
Apache
PHP Version:
8.2.29
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
home
/
ursites
/
public_html
/
public
/
website
/
app
/
CPU
/
View File Name :
image-manager.php
<?php namespace App\CPU; use Carbon\Carbon; use Illuminate\Support\Facades\Storage; use Intervention\Image\Facades\Image; class ImageManager { public static function upload(string $dir, string $format, $image, $file_type = 'image') { if ($image != null) { if(in_array($image->getClientOriginalExtension(), ['gif', 'svg'])){ $imageName = Carbon::now()->toDateString() . "-" . uniqid() . "." . $image->getClientOriginalExtension(); }else{ $image_webp = Image::make($image)->encode($format, 90); $imageName = Carbon::now()->toDateString() . "-" . uniqid() . "." . $format; } if (!Storage::disk('public')->exists($dir)) { Storage::disk('public')->makeDirectory($dir); } if(in_array($image->getClientOriginalExtension(), ['gif', 'svg'])) { Storage::disk('public')->put($dir . $imageName, file_get_contents($image)); }else{ Storage::disk('public')->put($dir . $imageName, $image_webp); $image_webp->destroy(); } } else { $imageName = 'def.webp'; } return $imageName; } public static function file_upload(string $dir, string $format, $file = null) { if ($file != null) { $fileName = Carbon::now()->toDateString() . "-" . uniqid() . "." . $format; if (!Storage::disk('public')->exists($dir)) { Storage::disk('public')->makeDirectory($dir); } Storage::disk('public')->put($dir . $fileName, file_get_contents($file)); } else { $fileName = 'def.png'; } return $fileName; } public static function update(string $dir, $old_image, string $format, $image, $file_type = 'image') { if (Storage::disk('public')->exists($dir . $old_image)) { Storage::disk('public')->delete($dir . $old_image); } $imageName = $file_type == 'file' ? ImageManager::file_upload($dir, $format, $image) : ImageManager::upload($dir, $format, $image); return $imageName; } public static function delete($full_path) { if (Storage::disk('public')->exists($full_path)) { Storage::disk('public')->delete($full_path); } return [ 'success' => 1, 'message' => 'Removed successfully !' ]; } }