0

I am using Maatwebsite's Laravel-Excel package. I want to import an Excel file, have laravel-excel ignore the first row, and use the second row as the collection attributes (table columns).

Without resorting to "import by config", is this possible?

It seems something like this has not yet been implemented. I haven't dug into the source code for laravel-excel as it's a bit daunting to me, but is there some hard-coded value I could change so it starts at row 1 (instead of 0) and uses that one for the attribute names?

chipit24
  • 6,509
  • 7
  • 47
  • 67
  • It's not yet implemented in my understanding. I guess most of the people fall in to first row as header and second row as content. or no header at all. – sarat Nov 24 '14 at 01:54
  • Mhmm. For now then, I will just delete the first row before importing. – chipit24 Nov 24 '14 at 02:06
  • Yeah, that make sense in a readability perspective too. – sarat Nov 24 '14 at 05:38

1 Answers1

0

You can use this reference .

https://github.com/Maatwebsite/Laravel-Excel/issues/458

Set Config::set('excel.import.startRow', $headerRowNumber); in Config/excel file

Then use Config in your controller.