Skip to content

Instantly share code, notes, and snippets.

@DB-009
Created October 14, 2014 19:03
Show Gist options
  • Save DB-009/398686a967e16296c405 to your computer and use it in GitHub Desktop.
Save DB-009/398686a967e16296c405 to your computer and use it in GitHub Desktop.
Dynamic navbar
@for ($i = 1; $i <= count($modules); $i++)
@foreach ($modules as $module)
@if($module->order == $i && $module->parent_id == 0)
@if($module->has_children >=1)
<li class="dropdown">
<a data-toggle="dropdown" class="dropdown-toggle" href="#">{{$module->module_title}}<b class="caret"></b></a>
<ul class="dropdown-menu"><li class="dropdown-header">Task Manager</li>
@foreach ($childs as $child)
@if($child->parent_id == $module->module_id)
<li><a href='#'>{{$child->module_title}}</a></li>
@endif
@endforeach
</ul>
</li>
@else
<li class="">
<a href="http://exhibitour.dev"> {{$module->module_title}}</a>
</li>
@endif
@endif
@endforeach
@endfor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment