I have implemented a way to get infinite depth in the menu in Laravel 4. This is not quite what you are asking for, but the technique should be easily adapted.
To start, my menu is just an array (at the moment), which is assigned to the main view and looks something like this.
$menu = array( array( 'name' => 'item1', 'url' => '/' ), array( 'name' => 'item2', 'url' => '/', 'items' => array( array( 'name' => 'subitem1', 'url' => '/' ), array( 'name' => 'subitem2', 'url' => '/' ) ) ) );
You can easily achieve this structure using the model as well. You will need the child_items function or something, since we will display the menu from top to bottom, and not from bottom to top.
Now in my main blade template, I do this:
<ul> @foreach ($menu as $item) @include('layouts._menuItem', array('item' => $mainNavItem)) @endforeach </ul>
And then in the layouts._menuItem template layouts._menuItem I do this:
<?php $items = array_key_exists('items', $item) ? $item['items'] : false; $name = array_key_exists('name', $item) ? $item['name'] : ''; $url = array_key_exists('url', $item) ? url($item['url']) : '#'; $active = array_key_exists('url', $item) ? Request::is($item['url'].'/*') : false; ?> <li class="@if ($active) active @endif"> <a href="{{ $url }}">{{ $name }}</a> @if ($items) <ul> @foreach ($items as $item) @include('layouts._menuItem', array('item' => $item)) @endforeach </ul> @endif </li>
As you can see, this template calls itself recursively, but with a different variable $item . This means that you can do as deep as you want in the structure of your menu. (The PHP block is designed to prepare some variables, so I could keep the actual code of the template clean and readable, technically it is not required).
I removed the Bootstrap Twitter code in the above snippets to make things simple (I actually have headers, dropdown buttons, icons, separators, ... in my template / array), so the code is not checked. The full version works fine for me, so let me know if I made a mistake somewhere.
Hope this helps you (or anyone else, because it's a pretty old question) along the way. Let me know if you need additional pointers / help or if you want to get the full code.
Happy coding!