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
不起作用。每次访问控制器时,我如何实现这个任务?