1$count = 0;
2DB::table('users')->chunk(200, function($users) use (&$count)
3{
4 Log::debug(count($users)); // will log the current iterations count
5 $count = $count + count($users); // will write the total count to our method var
6});
7Log::debug($count); // will log the total count of records