public function login(LoginRequest $request) { $user = ['email' => $request->email, 'password' => $request->password]; if (!Auth::check()) { if (Auth::attempt($user)) { //redirect home page redirect(); } else { //user login failed redirect('dangnhap'); } //user logged } else { redirect(); } }