Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Laravel Menu

Laravel Menu Laravel Package

akaunting/laravel-menu

A Laravel package for building and rendering menus with a fluent API. Define nested menu items, attach routes or URLs, manage active states, and render via Blade views with customizable ordering and markup.

View on GitHub
Deep Wiki
Context7

Menu and sidebar management package for Laravel

Frequently asked questions about Laravel Menu
How do I install akaunting/laravel-menu in a Laravel application?
Install it with composer require akaunting/laravel-menu. Laravel's package auto-discovery registers the service provider, so a manual entry in config/app.php is usually unnecessary. Check the repository README for any publishable config or view files you should export before defining your first menu.
Does akaunting/laravel-menu support nested menu items and submenus?
Yes. The fluent API is built around nesting, so you can define a parent item and attach children or sub-items to it. Rendering then walks that tree and produces nested markup according to your views. Keep the depth sensible for accessibility and inspect the generated HTML to confirm the nesting is correct.
How do I mark a menu item as active based on the current route?
Items can be tied to named routes or URLs, and the package handles active state so the current page's item receives an active class. You typically give the item a route name and let it compare against the current request. If your routes are ambiguous, verify the exact matching behaviour, such as wildcards and query strings, in the docs for your version.
How do I render a menu in a Blade template?
Menus are rendered through Blade, so you call the render helper or component the package exposes for a named menu inside your layout. Output uses the package's bundled views unless you override them. Confirm the exact render call in the README for the version you install, since APIs can shift between majors.
Can I customise the HTML markup and CSS classes of rendered menus?
Yes, the markup is customisable, and you can override the package's Blade views or pass your own classes and attributes to match your CSS framework. Because the views are ordinary Blade files, overriding or publishing them keeps future upgrades predictable. Avoid editing files inside the vendor directory directly.
Can I control the order in which menu items appear?
Yes, ordering is supported, and items render in the sequence you define them. If you need dynamic ordering, build the menu from a sorted collection before rendering rather than relying on definition order. Check whether your version offers an explicit sort or order method if you need finer control.
Can menu items point to both named routes and plain URLs?
Both are supported: an item can target a named route or a raw URL, which is handy for external links and paths outside the Laravel router. Route-based items get automatic active-state detection, while raw URLs are matched more literally. Always include the scheme on external URLs to avoid mixed-content problems.
Which Laravel and PHP versions does akaunting/laravel-menu support?
The 3.x line targets modern Laravel, and Laravel 9 through 11 on PHP 8.1 or newer is a reasonable assumption, but treat that as an inference until you read composer.json. Always check the illuminate/support and php constraints for the exact version you pin. Projects on older Laravel releases should stay on an earlier major.
Is it suitable for building an admin sidebar alongside other menus?
Yes. You can define multiple named menus, which makes it straightforward to maintain a top navigation, a footer menu, and a separate admin sidebar in the same codebase. Register each menu once, for example in a service provider, and render them independently per layout. This stops large admin menu definitions from leaking into public views.
How does it compare to other Laravel menu packages, and is it safe for production?
Alternatives include spatie/laravel-menu and lavary/laravel-menu, so compare feature fit, supported Laravel versions, and release cadence before committing. akaunting/laravel-menu is a small, focused package with no runtime dependencies beyond Laravel, which keeps upgrade risk low. Pin a version, run a static analysis pass, and add a feature test asserting your menu items and active states render as expected.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
elsayed85/laravel-api-exceptions
ouhssini/laravel-demo-mode
daworks/ncloud-outbound-mailer-driver
gp247/cms
ignibyte/aic-gates
nexa-merchant/blog
novasa/laravel-language-center
opencage/geocode
adolfoholzer/parameters
livenetworks/ln-starter
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
cgv/localized-resource