Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

JuanDBB's avatar

Change email for username in register

Hello,

I have succeeded replacing email for username in registration, but failed getting it working in login. It keeps asking for the email.

Do you know where should I change it ?

Thank you in advance.

0 likes
4 replies
Yamen's avatar
Yamen
Best Answer
Level 22

In AuthenticatesUsers.php trait, update username method to 'username':

public function username()
{
    return 'username'; // was 'email'
}

Does it work?

hbmaddog's avatar

@zLengend has the correct answer for the backend....

You may want to check your validators if your using any on the frontend too...

Please or to participate in this conversation.