0
使用Laravel 5.4
我正在使用內置身份驗證過程。
我要動態地改變這樣的:
/**
* URI where we redirect to after registration
*
* @var string
*/
protected $redirectTo = 'player/home';
像這樣:
/**
* The "booting" method of the model.
*/
protected static function boot()
{
if (session()->has('game.details.redirect')) {
$this->redirectTo = session()->get('game.details.redirect');
}
}
但上面的,因爲我不能在靜態方法來訪問$this
不起作用。每次訪問控制器時,我如何實現這個任務?