samedi 28 octobre 2017

required field if other field doesn't have specific value

I have a field project which is required if account_name field doesn't have the value '0'.I want to validate this scenario in laravel eg if account_name = '0' -project_name field is not required if account_name = '1' - project_name field is required

 $this->validate($request,[
     'project_name'=>'required_without:account_name,0',
    ]); 



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire