samedi 14 juillet 2018

required if validation with email adress

I am trying to validate one paypal id field based on payment option selected.

If payment option selected paypal then paypal_id must be present and type of email id. If payment option is credit then paypal id is not required.

$rule = [
            "paypal_id" => "required_if:payment-option,paypal|email"
        ];

But it gives me error "The paypal id must be a valid email address" When i select credit option. The paypal payment option works perfectly.

Any suggestions will helpful.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire