Hello
You mentioned that your users table have the 3 different columns: 'id', 'password', and 'username'
For your records, do they have the same username?
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi, currently i'm using default laravel authentication, it required email and password to login. But now, i want to change it, i want to login just using password, without email or even username. I have 'users' table which contain column 'id', 'password', and 'username' . And this table has three records filled. What i've done so far is :
in Illuminate/Foundation/Auth/AuthenticateUsers.php - some method i change to :
protected function validateLogin(Request $request)
{
$this->validate($request, [
'password' => 'required',
]);
}
protected function credentials(Request $request)
{
return $request->only('password');
}
and yes, it work. But.. it work if i submitted password that match with first record. When i try using password from second or third record, I don't know why, it didn't work. How can I fix this?
This cannot work since there must be an identifier to first locate the user's record and get their password
the password can then be checked
you cannot query the database using just the password because bcrypt of a string will never return the same string twice
In addition to it being impossible, it is also impractical since there is no means to deal with two users that have the same password - you cannot even check if two users have the same password!
Please or to participate in this conversation.