2
votes

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)

2
have tried doing yourself..? if yes, then please post code..Zedex7
@Zaheer Attar . no im using laravel default Auth system and everything is default now and i just changed logging in from email to phoneK1-Aria

2 Answers

0
votes

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

-1
votes

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