���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
/
dasterang-api
/
app
/
Console
/
Commands
/
Viewing: MoveImageUrls.php
<?php namespace App\Console\Commands; use Illuminate\Console\Command; 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\Vendor\Models\Business; use Modules\Vendor\Models\BusinessCategory; use Modules\Vendor\Models\BusinessImage; class MoveImageUrls extends Command { /** * The name and signature of the console command. * * @var string */ protected $signature = 'app:move-image-urls'; /** * The console command description. * * @var string */ protected $description = 'Command description'; /** * Execute the console command. */ public function handle() { 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; } } }
Coded With 💗 by
0x6ick Mod By V1rus_Alfa