-2

I want to import a csv:xlsx file which has 50 column and 1M rows I tried with laravel-excel package and Laravel queue. Some how i cant import the data. Nginx timeout given. I modify the max execution time in my php setting

In import controller public function import(Request $request) { Excel::import(new LeadsImport, $request->file); }

In LeadsImport

public function collection(Collection $rows) { dispatch(new ImportJob($rows)); }

1 Answers1

0

You should not call this type of heavy tasks from the browser because you are going to get timeout or worse out of memory error, due to the nature of webpages and the typical configuration.

I would make a custom command which make the heavy task of importing the 1M rows and for this if you use Eloquent make use of cursor or chunk methods of eloquent.

Hope this help.

https://qiita.com/ryo511/items/ebcd1c1b2ad5addc5c9d

Manuel Glez
  • 890
  • 3
  • 12