hellilyntax
hellilyntax

Reputation: 187

Maatwebsite Excel can't bypass empty row on Laravel 4

I'm using Laravel 4 and Maatwebsite Laravel Excel to import form CSV files. I managed to import each rows in the csv file successfully.
How ever, when it comes to empty files, the site returns: Row 2 is out of range (2 - 1). Here is my code:

                    Excel::load($source, function($reader) {
                    $reader->all(); 
                })

Is there any way to bypass empty row or to verify row count before process?

Upvotes: 1

Views: 2724

Answers (1)

hellilyntax
hellilyntax

Reputation: 187

Use this method to get row count. Then manipulate it.

->getTotalRowsOfFile()

Upvotes: 1

Related Questions