__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
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);
 }
 /**
  * @param  array $scopes
  * @return mixed
  */
 public static function handleScopes($scopes = [])
 {
     return parent::__callStatic('applyScopes', [new static(), $scopes]);
 }