mardi 28 janvier 2020

Show name of fields in message in Input Array Validation in Laravel

I have array of dropdown with the same name what i'm trying to do is to display the actual name of the field when the error is displayed but now it is displaying like

attributes.Size Attributes Fields are required

where size is the title that i'm passing dynamically

but i want actual name which i am passing as a title to an array.

Code:

$validator = Validator::make($request->all(), [
 'attributes.*' => 'required',
 ],[
 'attributes.*.required' => ':attribute Attributes Fields are required.',
 ]);

 {!! Form::select('attributes['.$attr->title.']') !!}


from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/38LPe8p
via IFTTT

Aucun commentaire:

Enregistrer un commentaire