dimanche 2 février 2020

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



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire