我有这样的功能:重定向到页面不工作?
public function index(Request $request){
$email = $request->email;
$password = $request->password;
if (!$email || !$password) {return redirect()->back();}
if (Auth::attempt(['email' => $email, 'password' => $password])) {
// Authentication passed...
$this->loggedUser = Auth::user();
if($this->loggedUser){
return redirect('http://localhost:3000/home');
}
}
return redirect()->back()->withInput()->withErrorMessage('Uneseni podaci nisu ispravni.');
}
我想要的是,如果他登录到用户重定向,但没有happend。当我打开我的浏览器预览它只是说
Redirecting to http://localhost:3000/home
但它不重定向我。任何建议?
当我手动输入出现
尝试'重定向(“/家庭”)' –
同样的问题..它只是说redirectin预览,但什么也没有发生 – None
这个方法做工精细的其他重定向? –