php - Get particular values multidimensional array Laravel
Solution:
you are not get direct use of item, you use $event_items = collect($events['03-11-2021']['0']->title);
Answer
Solution:
This result you have is basically a collection of collections of models. Collections implement array access so you can user $collection['index']
or you can use $collection->get('index')
. If you want all the values in the collection you can call the $collection->all()
method. I don't really understand what data you want to get from here or why you have a collection of collections in the first place but the $collection->map()
or $collection->transform()
method is usually used to extract specific data from a collection.
I also believe that $collection->items
is a private property so if you want all the items it is the same as $collection->all()
You can check Collections documentation for how they work.
Source