0
我從以前的Laravel 4.x下面有這段代碼。我怎樣才能將它轉換成Laravel 5.1?我想知道如何在構造函數(或中間件)中訪問路由參數,如果我將它轉換爲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'));
});
}
嘗試'$這個 - >路線( '項目');' –
方法[路徑]不存在。 –
'$ route-> parameter('projects');'給你什麼? –