cbugs

https://learnku.com/docs/laravel/5.8

 

源码路径 vendor\laravel\framework\src\Illuminate\Routing\Router.php

搜索 public function   #各种方法不说了
https://learnku.com/docs/laravel/5.8/routing/3890 官方文档

  

 源码路径 vendor\laravel\framework\src\Illuminate\Routing\Router.php

protected $allowedAttributes = [
        \'as\', \'domain\', \'middleware\', \'name\', \'namespace\', \'prefix\', \'where\',
    ];


//以上方法的属性的调用
public function __call($method, $parameters)
{
if (in_array($method, $this->passthru)) {
return $this->registerRoute($method, ...$parameters);
}

if (in_array($method, $this->allowedAttributes)) {
if ($method === \'middleware\') {
return $this->attribute($method, is_array($parameters[0]) ? $parameters[0] : $parameters);
}

return $this->attribute($method, $parameters[0]);
}

throw new BadMethodCallException(sprintf(
\'Method %s::%s does not exist.\', static::class, $method
));
}

  

posted on 2019-07-25 09:34  bug_x  阅读(307)  评论(0编辑  收藏  举报

分类:

技术点:

相关文章:

  • 2021-04-17
  • 2021-10-18
  • 2021-11-30
  • 2021-12-31
  • 2021-12-25
  • 2021-06-12
  • 2021-12-29
  • 2021-09-07
猜你喜欢
  • 2021-11-30
  • 2021-11-30
  • 2021-11-25
  • 2021-07-30
  • 2021-09-10
  • 2022-12-23
相关资源
相似解决方案