Illuminate\Database\Eloquent\Model::__callStatic PHP Method

__callStatic() public static method

Handle dynamic static method calls into the method.
public static __callStatic ( string $method, array $parameters ) : mixed
$method string
$parameters array
return mixed
    public static function __callStatic($method, $parameters)
    {
        $instance = new static();
        return call_user_func_array([$instance, $method], $parameters);
    }

Usage Example

Example #1
0
 public static function __callStatic($method, $parameters)
 {
     static $cachedRoles = null;
     if (is_null($cachedRoles)) {
         $cachedRoles = array_values(\Config::get('role.roles'));
     }
     if (in_array($method, $cachedRoles)) {
         return self::findByName($method);
     }
     return parent::__callStatic($method, $parameters);
 }
All Usage Examples Of Illuminate\Database\Eloquent\Model::__callStatic
Model