i am trying to use chunk method in laravel to show my data in the blade but I get it empty
here is my code
$accounts = Acc_account::where('cat', 2)->chunk(200, function (account) {
foreach ($accounts as $account) {
//
}
}); ;
and here is my code in blade
@foreach ($accounts as $item)
@endforeach
2
Answers
You can also use
paginate()
, in case of listing records in blade file.