Ad

Laravel Excel Big Export. Server Error 500

- 1 answer

I try to export 15000+ rows:

 Excel::create(...)->export('xls')

I get server error 500. Problem with memory or other?

Ad

Answer

It was memory limit error, not excel. Problem solved by separate query-builder results:

  $count = $User->count();
  $off_ex = 1000;
  for($j = 0;$j < $count/$off_ex;$j++){
    $users = $User->skip($j*$off_ex)->take($off_ex)->get();
    //...
  }
Ad
source: stackoverflow.com
Ad