Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

henock_barakael's avatar

get total number of rows before import

Hi everyone, How can i get total number of rows before import using Laravel Excel?

0 likes
4 replies
LaryAI's avatar
Level 58

You can use the count method on the Sheet class to get the total number of rows before import.

$totalRows = \Excel::load('file.xlsx')->getSheet()->count();

Please or to participate in this conversation.