What is the difference between laravel cursor and laravel chunk method?
Stefan Bogdanescu
Founder & Senior Architect · 2026-06-29
Laravel provides various ways to optimize your application's performance, and two of these methods are chunking and cursor methods. Both of them aim to improve efficiency and make large result sets more manageable, but they operate in different ways. In this comprehensive guide, we will provide a clear understanding of the differences between them, their use cases, and how they work behind the scenes.
Chunking Results
php
Flight::chunk(200, function ($flights) {
foreach ($flights as $flight) {
//
}
});Using Cursors
php
foreach (Flight::where('foo', 'bar')->cursor() as $flight) {
//
}