SpartnerNL / Laravel-Excel

🚀 Supercharged Excel exports and imports in Laravel
https://laravel-excel.com
MIT License
12.3k stars 1.93k forks source link

Chunk Imported not work #1362

Closed gamevnlc closed 7 years ago

gamevnlc commented 7 years ago

Please prefix your issue with one of the following: [BUG] [PROPOSAL] [QUESTION].

Package version, Laravel version

Laravel 5.4 maatwebsite/excel 2.1

Expected behaviour

Load data from csv file

Actual behaviour

Can't load data from csv file

Steps to reproduce the behaviour

I tried to load data from csv file by use the chunk imported, but there is no data , I don't know why. My csv file

https://drive.google.com/file/d/0Bz-YEwnA8p4RaXJIeVVJZUtVTDg/view?usp=sharing

aliusa commented 7 years ago

Please include your CSV import code and update Laravel to 5.5.4, Laravel-Excel to 2.1.12 and then check if you still have problems.

gamevnlc commented 7 years ago

@aliusa I can't upload into git , don't know why so I uploaded it on google drive.

aliusa commented 7 years ago

Please include sample code and update Laravel, Laravel-Excel.

image

gamevnlc commented 7 years ago

@aliusa Yes I tried by it seem that github doesn't accept csv file therefore I can't do it

image

aliusa commented 7 years ago

Did you update said dependencies and still experiencing error? Please include sample code.

gamevnlc commented 7 years ago

@aliusa Yes I updated all dependencies package. There is my composer.json and composer.lock files

I'm not sure it is bug or not. If I load my file like this I can read data

Excel::load($filePath, function($reader) {
    $results = $reader->get();
    dd($results);                    
});

but if I do like that , I can't read the data

Excel::filter('chunk')->load($filePath)->chunk(250, function($results)
{
    dd($results);
});
aliusa commented 7 years ago

chunk() is being queued. See #1209 Read the docs. Run queue worker or pass to chunk() 3rd parameter false or callback.

gamevnlc commented 7 years ago

@aliusa Ah I got it, thank you, and one more question what driver prerequisites is use in this package ?

aliusa commented 7 years ago

@gamevnlc I don't know what you mean.

fadynoor commented 7 years ago

@gamevnlc which driver did you use for the Queue Driver in .env? i experiencing the same problem. when i use "sync" for QUEUE_DRIVER, the impor works but only import 20 data. when i changed it into "database", the import seems like being skipped

and how to run the queue worker in production server?

gamevnlc commented 7 years ago

@aliusa chunk() is being queued. Therefore I want to know which kind of queue driver is use in this package

@fadynoor You must run the queue worker to process new jobs when they are pushed onto the queue https://laravel.com/docs/5.4/queues#running-the-queue-worker

aliusa commented 7 years ago

@gamevnlc I don't know which one, but I use database.