Laravel not Redirecting after manual user Authentication?

Posted 2 years ago by MohitDeshwal

##In LoginController.php I want to redirect user to home page.but it always shows blank page after authenticating user.

public function authenticater($data,$request)
    {
        $email=$data['email'];
        $check=User::where('email', '=',$email)->first();
        //if not found means we need to register the user

        if ($check != null) {
            // Authentication passed.....
            $id=intval($check->id);
            Auth::loginUsingId($id,true);
            //echo '<html><script>setTimeout(function(){ window.history.go(-1); }, 3000);</script></html>';
            //echo '<html><script>location.href="/";</script></html>';

             return redirect()->guest(route('home'));

        }

Please sign in or create an account to participate in this conversation.