I wish to count the rows of the imported excel. Currently I do something like this:
$imported = count(\Excel::load($file->getPathName(), function($reader) {})->get());
I am having the same issue. I would like help on this as well please. Thank You
You could use the count method on the Collection
$rows = \Excel::load($file->getPathName(), function($reader) {})->get();
$totalRows = $rows->count();
@dannyweeks' answer is correct
Thanks for this solution @dannyweeks
How do you prevent laravelexcel from counting empty rows that have borders or some other styling component?
$reader->ignoreEmpty();
@patrickbrouwers
Check how many rows in imported excel file. (version 3.1)
There is an example in the docs in the architecture chapter
$rows = \Excel::load($file->getPathName(), function($reader) {})->get();
$totalRows = $rows->count();
The Load is removed is there any other way to count the rows
@dannyweeks
Most helpful comment
You could use the
countmethod on the Collection