我的旧Laravel 4.x中有以下代码。如何将其转换为Laravel 5.1?我想知道如果我将它转换为Laravel 5.1,如何在构造函数(或中间件)中访问路径参数
谢谢!
public function __construct()
{
$this->beforeFilter(function($route, $request)
{
$this->user = Auth::user();
$this->project = $this->user->getProject( $route->parameter('projects') );
$this->group = $this->project->groups()->find( $route->parameter('groups') );
});
}
答案 0 :(得分:1)
我希望有人会得到这方面的帮助:
$request->route('companies')