我正在自定义 laravel 5 的内置登录,以便它根据我添加到用户表的类型列重定向到三个不同的路径,我尝试更改 RedirectIfAuthenticated 中间件的句柄函数。但它似乎总能找到主 URI。
这是我编辑的中间件
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 的新手,我非常感谢任何帮助和解释