got error
memory_limit = 1536M - I can’t set more
my code
Excel::download(new ReportExport($data), 'excel.xlsx');
$data
it collection data with 500000 rows +
How can i write so much data ?
Your PHP process runs out of memory when reading your view file. I think 500000 rows is a bit too much for the FromView strategy. You can try the approach this article took: https://stefanzweifel.io/posts/lazy-collections-in-laravel-excel/
Your PHP process runs out of memory when reading your view file. I think 500000 rows is a bit too much for the FromView strategy. You can try the approach this article took: https://stefanzweifel.io/posts/lazy-collections-in-laravel-excel/
I cant use cursor() because use Laravel version: 5.5.*. And I get the data not only from database, through calculations in php, because the database does not allow such calculations. In any case, I will have an array with 500,000 rows, before I give it to the generator Excel file.
@patrickbrouwers I tried the approach from the article but I get:
Return value of Maatwebsite\Excel\QueuedWriter::exportCollection() must be an instance of Illuminate\Support\Collection, instance of Illuminate\Support\LazyCollection returned
@fedeisas which version of laravel are you using?
@patrickbrouwers
laravel/framework v6.18.1 The Laravel Framework.
maatwebsite/excel 3.1.19 Supercharged Excel exports and imports in Laravel
phpoffice/phpspreadsheet 1.11.0 PHPSpreadsheet - Read, Create and Write Spreadsheet documents in PHP - Spreadsheet engine
I'm using queued writes. Maybe that's the issue?
I'm trying to do exports on distributed workers (using S3) and the FromQuery
is painfully slow (1 hour for a 30k rows export).
So I'm trying to switch to lazy collections and cursor()
with no luck.
@fedeisas use queue failed with error
Return value of Maatwebsite\Excel\QueuedWriter::exportCollection() must be an instance of Illuminate\Support\Collection, instance of Illuminate\Support\LazyCollection returned
but Excel::download is OK
i still can't export 60K data with FromQuery concern or LazyCollection with 512M memory setting
any other setting to implement this?
https://stefanzweifel.io/posts/lazy-collections-in-laravel-excel/
Most helpful comment
@fedeisas use queue failed with error
Return value of Maatwebsite\Excel\QueuedWriter::exportCollection() must be an instance of Illuminate\Support\Collection, instance of Illuminate\Support\LazyCollection returned
but Excel::download is OK