I have a couple of fields of type array
which I want to avoid by using Input::except()
. How do I do it? HTML is given below:
<tr>
<td>
{{ Form::input('text', 'batch_name[]', null, ['placeholder' =>'Enter batch name']) }}
</td>
<td>
{{ Form::input('date', 'availability_date[]', null) }}
</td>
<td>
<a class="add" title="Add Row" href="#"><img src="{{URL::to('public/assets/images/plus.png')}}" alt=""/></a>
</td>
</tr>
Following does not work and gives error:
htmlentities() expects parameter 1 to be string, array given
Validator::make(Input::except('_token','batch_name[]','availability_date[]'), $rules);
Ok I found the issue. I was using following in redirection:
return Redirect::to('admin/item/add')
->withErrors($validator)
->withInput(Input::except('_token'));
By Changing it to following worked:
return Redirect::to('admin/item/add')
->withErrors($validator)
->withInput(Input::except('_token','batch_name','availability_date'));