vendredi 26 octobre 2018

How to make rule not required when another field is present?

I have an image upload field which must not be empty when another field is selected to one:

required_if:digital_form,1

But in some cases the image is already in the database, and I display it in form:

@if
<div class="col-sm-6">
    <img src="" alt="img" style = "max-width:200px">
{!! Form::hidden('is_cover',1) !!}
@endif

In the case the image exists I would like to void the first rule but I am not sure how to achieve this.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire