Support the ongoing development of Laravel.io →
posted 9 years ago
Validation
Last updated 2 years ago.
0

You do not have to use email as a required field. You can have username or userid instead. And of course password. I'd always have at least 2 fields. You could for example set up an if statement and let user decide to use email or userid then password. Some sites do it that way. Just set up the correct control logic.
From the docs:

Note: In this example, email is not a required option, it is merely used as an example. You should use whatever column name corresponds to a "username" in your database.
0

I don't understand becouse I have not use email.

But my question is about the complete use of "sometimes", suppose if I delete a form field using Chrome inspector, the validation will pass if I use "required|sometimes".

0

Don't use sometimes, make the login fields required.

0

Sign in to participate in this thread!

Eventy

Your banner here too?

lovePizza lovepizza Joined 13 Mar 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.