Skip to content
Shea Lewis edited this page Apr 25, 2015 · 6 revisions

Adding a divider after a menu item is simple, and you have a couple ways of going about it as detailed below.

Add it directly to your menu item

$menu->add('Item Link', 'item/link')->divide();

Add it separately as its own item

$menu->add('Item Link', 'item/link');
$menu->divide();

Rendering

Both methods above will achieve the same results, by adding a new divider item after your link. So, if you were to use the asUl() method, you would get the following HTML:

<ul>
    <li><a href="item/link">Item Link</a></li>
    <li class="divider"></li>
</ul>

If you are building your own menu from scratch (a Bootstrap navbar for example), you can easily check to see if an item has a divider and add it:

@if ($item->divider)
    <li {{ \HTML::attributes($item->divider) }}></li>
@endif