我自定义laravel 5的内置登录,以便根据类型列将其重定向到三个不同的路径,我添加到users表中,我试着改变RedirectIfAuthenticated的句柄函数中间件。但它似乎总是找到家庭URI。Laravel 5自定义内置登录重定向
这里是我的编辑中间件
public function handle($request, Closure $next)
{
if ($this->auth->check() && $this->auth->user()->type == 'patient') {
// return redirect('/home');
return 'PATIENT VIEW';
} elseif ($this->auth->check() && $this->auth->user()->type == 'doctor') {
return 'DOCTOR VIEW';
} elseif ($this->auth->check() && $this->auth->user()->type == 'nurse') {
return 'NURSE VIEW';
}
return $next($request);
}
进出口新的laravel 5,我会非常感谢所有帮助和解释
非常感谢你:)这对我很有用。 –