babu.desai@icloud.com's avatar

setting laravel-excel heading row dynamically

Im working on project where our different properties upload their revenue and forcast excel file, and since each property has different format and row the actual data beings at i need be able to set laravel-excel heading on the fly, what would be the best way to do that. the heading row usually consists of | Date | Rooms Sold | Revenue | and bunch of other but i only need to grab date, rooms sold, and revenue columns. On the top its property info and who printed report and stuff and data usually starts around row 8 but thats different all the time.

0 likes
2 replies
macmedia's avatar

Im looking for answer to this as well. I know I can set the startRow in config/excel.php but I need to set the startRow on a file-by-file bases. Some files have the headers located on the first row and everything works fine. But other may start on row 3. Row 1&2 contain other information that is not important.

lejiend's avatar

config(['excel.import.startRow' => 4]);

1 like

Please or to participate in this conversation.