Just attempt with an array of the custom username column, e.g.
Auth::attempt(['my_special_username_column' => 'ACDMan', 'password' => 'password123']);
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hello! I'm a bit new to Laravel and I've been recently looking into Authentications. I was able to create a simple Login and Registration using the default User Model and login via the built in Auth:attempt.
Now, I've been trying to convert an existing website for testing purposes but the existing database was made via plain PHP and their database do not follow Laravel's naming conventions so I've been having a problem on making Auth:attempt work on the custom columns. I've been messing around with the my website's default User model a bit and it seems public function getAuthPassword() deals with handling the column name for the password but I dont know which function handles the username part of the authentication. I tried getAuthIdentifier and getAuthIdentifierName and neither seems to work or modify what column name the Auth:attempt is using.
Just attempt with an array of the custom username column, e.g.
Auth::attempt(['my_special_username_column' => 'ACDMan', 'password' => 'password123']);
Please or to participate in this conversation.