I'm struggling to find an answer to this problem
If the login password is wrong I want to display an error message.
This is my login function
public function postSignIn(Request $request)
{
$this->validate($request, [
'email' => 'required|exists:users',
'password' => 'required'
]);
if (Auth::attempt(['email' => $request['email'], 'password' => $request['password']])) {
return redirect()->route('dashboard');
}
return redirect()->back();
}
I have tried these methods but they not working.
(doesnt allow login even if password is correct)
'password' => 'confirmed'
(doesnt show any errors if password is wrong)
'password' => 'same:password'
(doesnt allow login even if password is correct)
'password' => 'same:pass'
My email authentication is working fine. Just want to display an error if the password is wrong for the email entered. Also my login does already work I've tested.