collection is obtrained like this
Collection {#241 ▼
#items: array:2 [▼
"Oct-2016" => Collection {#225 ▼
#items: array:1 [▼
0 => Event {#243 ▶}
]
}
"Nov-2016" => Collection {#236 ▼
#items: array:2 [▼
0 => Event {#244 ▶}
1 => Event {#245 ▶}
]
}
]
}
i want to show data like .
Oct 2016
event 1
Nov 2016
event 1
event 2
i am new in laravel kindly help me how to show collection key in title Oct-2016 and list of each key collection in blade
Laravel collections implement php's iterable functionality. In other words, you can just use foreach loops. This will give you the basic idea.
foreach ($collection as $month => $events)
{
var_dump($month);
foreach ($events as $event)
{
var_dump($event);
}
}