Laravel manual login function

Instead of this

Auth::login($userMail->email, TRUE);

Use this

Auth::login($user->id, TRUE);


Login function needs user of type Authenticatable and you just given email which is string thats why you get this error, Either use Auth::loginUsingId($id);

 $user = User::where('email','=',$email)->first();
 Auth::loginUsingId($user->id, TRUE);

Or just

Auth::login($user);

The Auth::login() function expects an Authenticable object. If you have not messed with the User class, this will be what you need to pass in.

Auth::login($user, true);

Reference: https://laravel.com/api/5.5/Illuminate/Auth/SessionGuard.html#method_login


$email = $request->email;
    $password = md5($request->password);

    if ($request->remember_me == 1) {
        $cookie =  Cookie::queue('username', $email, time() + 31536000);
    } else {
        $cookie =  Cookie::queue('username', '', time() - 100);
    }

    $user = DB::table('tbl_adminuser')->where('email_address', $email)->where('password', $password)->first();
    $request->session()->put('userData', $user);

=> You can manual login like this in laravel