Reputation: 361
I have an array $data['result'] ,and I can access it by $data['result']
, I want to access the array inside the result array called items and then again the items array inside that items array. Please help.
Upvotes: 0
Views: 1961
Reputation: 62248
$data['result']
is a LengthAwarePaginator
.
The first items
child is a Collection
representing the slice of data being paginated.
The items
in the Collection
is the array of items represented by the Collection
.
You can access this array from the paginator using the items()
method.
$collectionItems = $data['result']->items();
Upvotes: 1