���Root Mod By V1rus_Alfa
User / IP
:
216.73.216.158
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
/
dasterang-api
/
modules
/
File
/
Http
/
Controllers
/
Api
/
Admin
/
Viewing: FixAllImages.php
<?php namespace Modules\File\Http\Controllers\Api\Admin; use Illuminate\Support\Facades\DB; use Modules\Blog\Models\Article; use Modules\Feature\Models\Gallery; use Modules\File\Models\File; use Modules\File\Models\ProductImage; use Modules\File\Models\ProductSamplePerformedImage; use Modules\Product\Models\Product; use Modules\Settings\Models\Slideshow; use Modules\Shared\Http\Controllers\BaseCrudHandler; use Modules\Shared\Services\Responder; use Modules\Vendor\Models\Business; use Modules\Vendor\Models\BusinessCategory; use Modules\Vendor\Models\BusinessImage; use Modules\Vendor\Models\Shop; class FixAllImages extends BaseCrudHandler { public function execute(array $attributes = []) { DB::beginTransaction(); try { Article::whereNotNull('image')->get()->each(function ($article) { $image = $article->image; $path = str_replace('https://shemshetaraz.com/Dasterang/', '', $image); $file = File::create([ 'host_name' => 'shemshetaraz', 'path_prefix' => 'Dasterang', 'path' => $path, 'type' => 'image', ]); $article->image_id = $file->id; $article->save(); }); Business::whereNotNull('image')->get()->each(function ($business) { $image = $business->image; $path = str_replace('https://shemshetaraz.com/Dasterang/', '', $image); $file = File::create([ 'host_name' => 'shemshetaraz', 'path_prefix' => 'Dasterang', 'path' => $path, 'type' => 'image', ]); $business->image_id = $file->id; $business->save(); }); BusinessCategory::whereNotNull('image')->get()->each(function ($record) { $image = $record->image; $path = str_replace('https://shemshetaraz.com/Dasterang/', '', $image); $file = File::create([ 'host_name' => 'shemshetaraz', 'path_prefix' => 'Dasterang', 'path' => $path, 'type' => 'image', ]); $record->image_id = $file->id; $record->save(); }); BusinessImage::whereNotNull('image')->get()->each(function ($record) { $image = $record->image; $path = str_replace('https://shemshetaraz.com/Dasterang/', '', $image); $file = File::create([ 'host_name' => 'shemshetaraz', 'path_prefix' => 'Dasterang', 'path' => $path, 'type' => 'image', ]); $record->image_id = $file->id; $record->save(); }); Gallery::whereNotNull('image')->get()->each(function ($record) { $image = $record->image; $path = str_replace('https://shemshetaraz.com/Dasterang/', '', $image); $file = File::create([ 'host_name' => 'shemshetaraz', 'path_prefix' => 'Dasterang', 'path' => $path, 'type' => 'image', ]); $record->image_id = $file->id; $record->save(); }); Product::all()->each(function ($record) { $thumb = $record->thumb; $path = str_replace('https://shemshetaraz.com/Dasterang/', '', $thumb); $thumbFile = File::create([ 'host_name' => 'shemshetaraz', 'path_prefix' => 'Dasterang', 'path' => $path, 'type' => 'image', ]); $profile = $record->profile; $path = str_replace('https://shemshetaraz.com/Dasterang/', '', $profile); $profileFile = File::create([ 'host_name' => 'shemshetaraz', 'path_prefix' => 'Dasterang', 'path' => $path, 'type' => 'image', ]); $record->thumbnail_image_id = $thumbFile->id; $record->profile_image_id = $profileFile->id; $record->save(); }); ProductImage::all()->each(function ($record) { $image = $record->image; $path = str_replace('https://shemshetaraz.com/Dasterang/', '', $image); $file = File::create([ 'host_name' => 'shemshetaraz', 'path_prefix' => 'Dasterang', 'path' => $path, 'type' => 'image', ]); $record->image_id = $file->id; $record->save(); }); ProductSamplePerformedImage::all()->each(function ($record) { $image = $record->image; $path = str_replace('https://shemshetaraz.com/Dasterang/', '', $image); $file = File::create([ 'host_name' => 'shemshetaraz', 'path_prefix' => 'Dasterang', 'path' => $path, 'type' => 'image', ]); $record->image_id = $file->id; $record->save(); }); Slideshow::all()->each(function ($record) { $image = $record->image; $path = str_replace('https://shemshetaraz.com/Dasterang/', '', $image); $file = File::create([ 'host_name' => 'shemshetaraz', 'path_prefix' => 'Dasterang', 'path' => $path, 'type' => 'image', ]); $record->image_id = $file->id; $record->save(); }); DB::commit(); } catch (\Throwable $th) { DB::rollBack(); throw $th; } } public function authorize() { return true; } }
Coded With 💗 by
0x6ick Mod By V1rus_Alfa