All fields are my forms have their names in parentheses to group them by their parents and to identify them as duplicate items, such as: fieldName_01[0][0]. Of course, this makes it impossible to use the Laravel Validator class, as it raises an error, referring to the fact that it does not expect an array. This naming convention is common practice, so this cannot be a rare problem.
I see a couple of other similar questions ( HERE and HERE ), but I can "It seems they understand them (Laravel noob), or I just don’t know how and where to implement the solutions. In this answer , where would I create this extended class? How do I tell Laravel to include it in my project?
An example of my elements:
<div class="form-group col-sm-4'}}">
{{ Form::label('fieldName_01[0][0]', 'My Element', array('class'=>'col-sm-3'))}}
<div class="col-sm-7 col-md-6 recurringField">
{{ Form::text('fieldName_01[0][0]', null, array(
'class'=>'form-control input-md',
'placeholder'=>'My Element',
'data-element-code' => '',
'data-recur-group' => 'fieldName_01',
'id'=>'fieldName_01[0][0]',
'data-fkey' => '0',
'data-pkey' => '0'
)) }}
</div>
</div>
An example of my rule:
'fieldName_01'=>'required|alpha_num|between:2,255'
An example of how I call the validator:
$input = Input::all();
$validator = Validator::make($input, $this->rules);
source
share