stuck in if/elseif/else statement in controller
<p>I have a login page . It's controller function has 3 cases:</p>

<p>case 1. email or password is wrong->shows error //working fine</p>

<p>case 2. email is not confirmed->shows error //working fine</p>

<p>case 3. everything is fine->should loggedIn // not working // shows a blank page</p>

<p>my logic:</p>

<pre><code>public function postSignIn(Request $request)
{    
    $this-&gt;validate($request,[
        'loginEmail'=&gt; 'required' ,
        'loginPassword' =&gt; 'required'
    ]);

    $remember = $request-&gt;input('remember_me');
    $user=User::where('email', $request['loginEmail'])-&gt;first();

    if(!$user)
    {
        \Session::flash('message','Login credentials are wrong!');
        \Session::flash('alert-class', 'alert-warning'); 
        return redirect()-&gt;back();
    }
    elseif($user-&gt;confirmed==1) 
    {
        if(Auth::attempt(['email'=&gt;$request['loginEmail'], 'password' =&gt; $request['loginPassword']],$remember))
        {

            //return redirect()-&gt;back();
            return redirect()-&gt;route('myplace',['username' =&gt; $user-&gt;username]) ;
        }
    }
    else
    {
        \Session::flash('message','Please verify your email!');
        \Session::flash('alert-class', 'alert-warning'); 

        return redirect()-&gt;back();
    }       
}
</code></pre>