How do I change my user authentication to another column in the db as username in laravel?

0

What I want to do is change the use of the "email" column to login using the "name" column.

I followed this tutorial on youtube: link

I do exactly what he does but fail in the attempt. Any suggestions why?

    
asked by Pablo Contreras 03.01.2017 в 05:16
source

1 answer

2

If you are using the default login method laravel, just create a function, in the login file found in the folder:
App - > Http - > Controllers - > Auth

public function username()
{
    return field;
}

where field is the field to be used in the database, since the auth of laravel method calls that function to know which field to read in the database.

    
answered by 03.01.2017 / 05:30
source