lundi 15 juillet 2019

Stop Laravel password validation if username or email is empty

I have a custom login form that verifies credentials with an API. Everything is working well except that if I leave the username/email field blank and enter a password, the API call is still sent when it should stop before that.

I had a look at the rules bail, required_with (and other similar) but none of them fits the bill.

Is there a way to have only the validation message:

The identifier field is required.

Instead of

The identifier field is required.

Sorry, this is not the password associated with your identifier. Please check and try again.

(stop password validation if username/email is empty?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire