You can loop through results as below. You can then compare the show_year against the previous iteration in the loop to determine if you should echo another year heading.
foreach($shows as $show)
{
// echo show name
foreach($show->showrefs as $ref)
{
// echo ref information
}
}
Thanks iWader, makes sense. Where would all of this occur, in the controller or the view? Is it a case of this happens in the controller and you make it an array/collection, and then foreach again in the view?
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community