spatie/menu
Fluent, extensible menu builder for Laravel. Compose navigation with a clean API, render as HTML, and customize output via presenters and macros. Supports active state handling, links, submenus, and easy integration with Blade and your app’s routing.
You can render menus without ul and li tags. This can be achieved with the setWrapperTag, withoutWrapperTag, setParentTag and withoutParentTag methods.
Without wrapper tag & without parent tag:
Menu::new()
->withoutWrapperTag()
->withoutParentTag()
->link('/', 'Home')
->link('/about', 'About');
<a href="/">Home</a>
<a href="/about">About</a>
Without wrapper tag & with custom parent tag:
Menu::new()
->withoutWrapperTag()
->setParentTag('span')
->link('/', 'Home')
->link('/about', 'About');
<span><a href="/">Home</a></span>
<span><a href="/about">About</a></span>
With custom wrapper tag & without parent tags:
Menu::new()
->setWrapperTag('nav')
->withoutParentTag()
->link('/', 'Home')
->link('/about', 'About');
<nav>
<a href="/">Home</a>
<a href="/about">About</a>
</nav>
With custom wrapper tag & custom parent tags:
Menu::new()
->setWrapperTag('nav')
->setParentTag('span')
->link('/', 'Home')
->link('/about', 'About');
<nav>
<span><a href="/">Home</a></span>
<span><a href="/about">About</a></span>
</nav>
How can I help you explore Laravel packages today?