How to create lazy collection in laravel on big data?
-
Hello everyone, I read guide on laravel lazy collections how to work with the database it is clear how to read large files is also clear.
But if I need to generate a collection (for example, just a list of strings) that is generated in a loop but more than can be placed in the ram (and not saved to the database), then how to make such a collection swap to disk? - or is it not provided in principle? I still do not understand, to be honest, you can clarify this issue.Laravel Olivia Gross, Jun 24, 2020 -
You seem to need generators: https://www.php.net/manual/en /language.generators.phpJane Macias
1 Answers
Your Answer
To place the code, please use CodePen or similar tool. Thanks you!