使用laravel matwebsite只导入第二行的标题行



如何只导入标题行,这是在第二行使用laravel maatwebsite?

这是我的控制器代码:
HeadingRowFormatter::default('none');
$headings = (new HeadingRowImport)->toArray($request['student_upload_file']);

这将获得第一行。我需要第二行

您应该能够通过传递2作为HeadingRowImport参数获得第二行。

$headings = (new HeadingRowImport(2))->toArray($request['student_upload_file']);

https://github.com/Maatwebsite/Laravel-Excel/blob/3.1/src/HeadingRowImport.php L23-L34