My ajax script send array like this:
This array belong to Input::get('questions')
Array
(
[0] => Array
(
[name] => fields[]
[value] => test1
)
[1] => Array
(
[name] => fields[]
[value] => test2
)
)
In html part user can add multiple fields.
Could you help me with I need something like this:
$inputs = array(
'fields' => Input::get('questions')
);
$rules = array(
'fields' => 'required'
);
$validator = Validator::make($inputs,$rules);
if($validator -> fails()){
print_r($validator -> messages() ->all());
}else{
return 'success';
}