toneee
3 years ago
14
14
General

Auth::attempt fails every time

Posted 3 years ago by toneee

Hi,

I am trying to write a custom auth controller, but am having problems with the Auth::attempt part of a login. I have the default database setup and names. I think its a problem with the hashing of the password, but apparently this should happen automatically with the Auth::attempt function?

Here is my class, can anyone help please?

public function authenticate(Request $request)
{
    if (Auth::attempt(['email' => $request->email, 'password' => $request->password])) {
        echo "Login OK";
    }
    else {
        echo "Login Failed";
    }
}

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