Laravel 6 - Working with Lazy Collection
5 years ago
Lazy Collection introduced in Laravel 6 that will help to keep the memory usages low. It will use the PHP generators in the backend to achieve this. You can use rest of the collection methods to filter data from Lazy Collection.
$users = \App\User::cursor();
dd($users->first());
Link: