Итак, у меня есть файл Excel с таким форматом, как этот
![enter image description here](https://i.stack.imgur.com/orDSF.png)
![enter image description here](https://i.stack.imgur.com/naQoZ.png)
Я пытаюсь получить все строки ниже row1
Это будут записи John Doe
и Mc Doe
В настоящее время у меня есть этот код из controller
$dateTime = date('Ymd_His');
$file = $request->file('file');
$fileName = $dateTime . '-' . $file->getClientOriginalName();
$savePath = public_path('/upload/projectlist/');
$file->move($savePath, $fileName);
$excel = Importer::make('Excel');
$excel->load($savePath.$fileName);
$collection = $excel->getCollection();
if(sizeof($collection[1]) == 5){
for($row=1; $row<sizeof($collection); $row++){
try{
dd($collection[$row]);
}
catch(\Exception $e){
return redirect()
->back()
->with(['errors'=>$e->getMessage()])
->with('modal',$modal);
}
}
}else{
return redirect()
->back()
->with(['errors'=> [0=> 'Please provide date in file according to your format.']])
->with('modal',$modal);
}
И это дает мне такой вывод
![enter image description here](https://i.stack.imgur.com/b9riP.png)
Который только для записи John Doe
. Как я могу получить все строки, кроме row1
?