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

Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 

uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 

uid=33(www-data) gid=33(www-data) groups=33(www-data) 

Safe-mode: OFF (not secure)

/var/www/html/main_file/vendor/laravel/framework/src/Illuminate/Database/Eloquent/   drwxr-xr-x
Free 12.92 GB of 57.97 GB (22.29%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


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

namespace Illuminate\Database\Eloquent;

use 
BadMethodCallException;
use 
Illuminate\Database\Eloquent\Relations\HasMany;
use 
Illuminate\Support\Str;

class 
PendingHasThroughRelationship
{
    
/**
     * The root model that the relationship exists on.
     *
     * @var \Illuminate\Database\Eloquent\Model
     */
    
protected $rootModel;

    
/**
     * The local relationship.
     *
     * @var \Illuminate\Database\Eloquent\Relations\HasMany|\Illuminate\Database\Eloquent\Relations\HasOne
     */
    
protected $localRelationship;

    
/**
     * Create a pending has-many-through or has-one-through relationship.
     *
     * @param  \Illuminate\Database\Eloquent\Model  $rootModel
     * @param  \Illuminate\Database\Eloquent\Relations\HasMany|\Illuminate\Database\Eloquent\Relations\HasOne  $localRelationship
     */
    
public function __construct($rootModel$localRelationship)
    {
        
$this->rootModel $rootModel;

        
$this->localRelationship $localRelationship;
    }

    
/**
     * Define the distant relationship that this model has.
     *
     * @param  string|(callable(\Illuminate\Database\Eloquent\Model): (\Illuminate\Database\Eloquent\Relations\HasOne|\Illuminate\Database\Eloquent\Relations\HasMany))  $callback
     * @return \Illuminate\Database\Eloquent\Relations\HasManyThrough|\Illuminate\Database\Eloquent\Relations\HasOneThrough
     */
    
public function has($callback)
    {
        if (
is_string($callback)) {
            
$callback = fn () => $this->localRelationship->getRelated()->{$callback}();
        }

        
$distantRelation $callback($this->localRelationship->getRelated());

        if (
$distantRelation instanceof HasMany) {
            return 
$this->rootModel->hasManyThrough(
                
$distantRelation->getRelated()::class,
                
$this->localRelationship->getRelated()::class,
                
$this->localRelationship->getForeignKeyName(),
                
$distantRelation->getForeignKeyName(),
                
$this->localRelationship->getLocalKeyName(),
                
$distantRelation->getLocalKeyName(),
            );
        }

        return 
$this->rootModel->hasOneThrough(
            
$distantRelation->getRelated()::class,
            
$this->localRelationship->getRelated()::class,
            
$this->localRelationship->getForeignKeyName(),
            
$distantRelation->getForeignKeyName(),
            
$this->localRelationship->getLocalKeyName(),
            
$distantRelation->getLocalKeyName(),
        );
    }

    
/**
     * Handle dynamic method calls into the model.
     *
     * @param  string  $method
     * @param  array  $parameters
     * @return mixed
     */
    
public function __call($method$parameters)
    {
        if (
Str::startsWith($method'has')) {
            return 
$this->has(Str::of($method)->after('has')->lcfirst()->toString());
        }

        throw new 
BadMethodCallException(sprintf(
            
'Call to undefined method %s::%s()', static::class, $method
        
));
    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

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

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