Laravel: How can I change the default Auth Password field name?

For having username instead of email, you can overwrite username() in your LoginController.php

/**
 * Get the login username to be used by the controller.
 *
 * @return string
 */
public function username()
{
    return 'username';
}

And for passwd instead of password, you can do define an accessor in your App\User.php

/**
 * Get the password for the user.
 *
 * @return string
 */
public function getAuthPassword()
{
    return $this->passwd;
}

login.blade.php : Replace email input with username but do not change the name of the input for password.

Leave a Comment