Answer the question
In order to leave comments, you need to log in
How to import CSV 300k rows in Laravel?
I am using laravel-excel lib.
Network file of 130 MB and 300k lines, you need to add it to the database.
I decided to do it through queues, but the problem is that when I load this file, the sled read does not work and, accordingly, does not add it to the database.
If you upload a file with fewer lines, then everything works.
How can I download such a file?
Answer the question
In order to leave comments, you need to log in
umm.... why do you need laravel-excel to import csv?
take the package from the league and read line by line. I import them millions of lines every day, without any queues.
https://csv.thephpleague.com/
If you upload a file with fewer lines, then everything works.Read into memory not the entire file at once, but for example 10k lines. But in general, csv is just a text file (this is to the fact that excel and csv are very different inside). with a separator between lines, you can write your own solution, which will not be difficult to implement
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question