问题
I'm currently using the default Authentication of Laravel (php artisan make:auth)
But since it's very crucial for us to change the email-field to a username-field, I will need some help on that. I already tried to give it a shot, but I couldn't figure it out.
Help would be nice.
回答1:
As you can see in the authentication quickstart from the Laravel's Documentation at the "Username Customization" paragraph, you can easily customize the data that the user use to authenticate :
By default, Laravel uses the email field for authentication. If you would like to customize this, you may define a username method on your LoginController :
public function username()
{
return 'username';
}
来源:https://stackoverflow.com/questions/52591165/laravel-question-how-can-i-change-the-email-field-to-username