The part of form (the field text array)[1]:
<div id="cp1">
<div class="form-group">
{!! Form::text('names[]',null,['class'=>'form-control', 'maxlength'=>'30', 'placeholder'=>'Name']) !!}
</div>
<div class="form-group">
{!! Form::text('contents[]',null,['class'=>'form-control', 'maxlength'=>'30', 'placeholder'=>'Content']) !!}
</div>
</div>
When i send the form, validation fails with: htmlentities() expects parameter 1 to be string, array given (View: /Applications/MAMP/htdocs/telovendogdl/resources/views/ads/new.blade.php)
this is the rules in form request:
return ['title' => 'required|min:8|max:100',
'description' => 'required|min:10|max:1100',
'price' => 'required|integer|max:15',
'city_name'=> 'required|max:70',
'category_id' => 'required|integer',
'delivery'=> 'max:70',
];
This is the function in the controller:[2]
public function newAdStore(StoreNewAdRequest $request)
{
$newAd = new Ad;
$newAd->user_id = \Auth::user()->id;
$newAd->active = 0;
$newAd->city_name = $request->input('city_name');
$newAd->category_id = $request->input('category_id');
$newAd->fill($request->all());
$newAd->save();
}
but only fails when i send the array fields from the form [1], when a delete this fields all works? what happen with that[2]?