I have laravel 5.2, i want to validate the csv upload, let's say i have an array from uploaded csv like this :
array(
'code' => '1',
'name' => 'asd'
)
and my validation like this
rules = [
'code' => 'required|numeric',
'name' => 'required'
];
but i used a locale for my laravel project, so when i export to csv, the title will not alway code and name, i could be japanese language or others, so how to create my validation rule?
How to validate each row from index number?
foreach( $uploaded_data as $row ) {
$rules = [
0 => 'required|numeric',
1 => 'required'
];
}