Change the Fortify login field

Fortify's username config key is the input name. The Vue login form has to post that same name.

For your AI agent

Copies a prompt. Paste it into the AI agent you already have open.

Read https://laravel-vuejs.space/fortify-login-username-vue.md
Fortify's username config key is the input name. The Vue login form has to post that same name.
Do not accept either email or username unless you wrote a custom user provider.
Show the diff. Do not commit.
On this page · 3 sections
  1. The fix
  2. What to avoid
  3. FAQ

People searching “Fortify login username” rename the database column and leave the form posting email. Fortify reads the key in config/fortify.php.

TL;DR

  • Fortify’s username config key is the input name.
  • The Vue login form has to post that same name.
  • Do not accept either email or username unless you wrote a custom user provider.

Who it's for: Laravel + Vue developers

Applies to: Laravel 13 · Vue 3

The fix#

php
'username' => 'email',

Change that to the column you actually look up, then match the Vue input:

vue
<input v-model="form.email" name="email" type="email" autocomplete="username" />

If the config says username, the input name and the useForm key are username. The validation error comes back on that same key. The Fortify guide shows the POST to /login after the CSRF cookie, for a separate SPA. An Inertia kit posts /login on the same origin and does not need that cookie call.

What to avoid#

Gotcha

Do not accept either email or username unless you wrote a custom user provider. Changing the label on the page does not change the column Fortify queries.

FAQ#

How do I change the Fortify login field?

Fortify's username config key is the input name. The Vue login form has to post that same name.

What goes wrong with Fortify login username?

Many developers rename the database column and leave the form posting email. Do not accept either email or username unless you wrote a custom user provider.

Found this useful?

Ask questions, share what you built.

Join thousands of Laravel and Vue developers in our Facebook group, or get new posts in your Telegram feed. Sharing this article helps too.

Keep reading

Newsletter

Get the best of Laravel & Vue, once a month.

One short email with new guides, release notes worth reading and hand-picked community links. No spam, unsubscribe any time.