Laravel-excel: Check total rows before Queue import to Model

Created on 5 Aug 2019  路  7Comments  路  Source: Maatwebsite/Laravel-Excel

Prerequisites

Versions

PHP version: 7.1.9-1+ubuntu16.04.1+deb.sury.org+1
Laravel version: 5.8.24
Package version: 3.1.15

Description

Is it possible to check how many total rows there are in the CSV file to be imported to Model.
I want to know how many rows are going to be imported before the queue.

$partDetailsImport = new PartDetailsImport();
Excel::queueImport($partDetailsImport, $file);

Or can i check the total number of rows to be imported by adding a function to the PartDetailsImport class ?

Is this achievable ?

Thank you

question

All 7 comments

Thanks for submitting the ticket. Unfortunately the information you provided is incomplete. We need to know which version you use and how to reproduce it. Please include code examples. Before we can pick it up, please check (https://github.com/Maatwebsite/Laravel-Excel/blob/3.1/.github/ISSUE_TEMPLATE.md) and add the missing information. To make processing of this ticket a lot easier, please make sure to check (https://laravel-excel.maatwebsite.nl/3.1/getting-started/contributing.html) and double-check if you have filled in the issue template correctly. This will allow us to pick up your ticket more efficiently. Issues that follow the guidelines correctly will get priority over other issues.

Hey @GlennM ,

Im not too sure how i can go about using the PHPspreadsheet function of getHighestRow.
Could you please help with an example ??

Would really appreciate it ! thank you

Take a look at https://docs.laravel-excel.com/3.1/imports/extending.html
You can hook into the eventsm the use getDelegate() to access PHPSpreadsheet.

I am facing a problem with rows null value during import the excel file. Would someone have a look into my problem please - https://stackoverflow.com/q/57738878/7014431

@rashed50702 Please open a new issue (and use the template). "Hijacking" another topic is not the way support works. There are some replies on Stackoverflow at the moment, please check those first...

Any solution for this issue? I have tried static variable to count, but still not work.

Was this page helpful?
0 / 5 - 0 ratings