Reputation: 1146
i am using Laravel 5.4.17 i changed login field from email
to phone
.
but in password reset, when user changed his password, (email - new password - password confirm) the browser will ask for save new password and the email will save as password in input
i don't want to change reset password form email to another. but my problem is after send email, when user is changing his password (first field is email and i want browser dont save it as username)
Upvotes: 2
Views: 1954
Reputation: 743
In 5.4 you need to override the following function
public function username()
Look in: vendor/laravel/framework/src/Illuminate/Foundation/Auth/AuthenticatesUsers.php
The default is to return email:
public function username()
{
return 'email';
}
After adding the fields in your db, you can override as follows in your controller
public function username()
{
return 'phone';
}
add 1 more column in user table name phone hope its work fine
Upvotes: -1
Reputation: 4738
Use the username()
method on your User
model to return the identifier column name...
public function username()
{
return 'phone';
}
https://laravel.com/docs/5.4/authentication#authentication-quickstart
Upvotes: 0