You can try this code
private static function prepareMenu($tree)
{
$data = '<ul class="nav navbar-nav">';
foreach ($tree as $item)
{
$data .= '<li><a href="' . $item->url . '">' . $item->title . '</a></li>';
if (count($item->children) > 0)
{
$data .= self::prepareMenu($item->children);
}
}
$data .= '</ul>';
return $data;
}
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community