How to check the last chunk?

i'm using the chunk method chunk to get big data but i need to know the last chunk, because i'm punting the data in file, and at the last chunk i don't want to add something to the file , so i need to know the last chunk

DB::table('users')->chunk(100, function($users)
{
//how to know if it's the last chunk or not ?
foreach ($users as $user)
{
//
}
});

is their a way to know the last chunk



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2ufjZDU
via IFTTT

تعليقات

المشاركات الشائعة من هذه المدونة

I am unable to figure out how to create payment collection request, after a form has been submitted in laravel

laravel, mysql transaction not working after failed one time