lundi 23 mai 2016

laravel array required validation every fired event value is exists?

below id my validation code.

$rules = [
    'other_feature[]' => required
];

$message = [
     'other_feature[].required' => 'The other feature field is required.',
];

$this->validate($request, $attributes_validation, $attributes_message);
$result = $this->UploadRepo->updateUploadValue($data,$id);

in other_feature pass multiselect value like.

<select name='other_feature[]' multiple>
   <option>First</option>
   <option>Second</option>
   <option>Third</option>
   <option>Four</option>
   <option>Five</option>
</select>

where I create a mistake in validation why empty validation is fired every time even I select value please help.

Thanks



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/25jaxKO
via IFTTT

Aucun commentaire:

Enregistrer un commentaire