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 Dynamic Menu

Laravel Dynamic Menu Laravel Package

rapidwebltd/laravel-dynamic-menu

Laravel Dynamic Menu lets you build database-driven navigation menus in Laravel without hardcoding links. Define nested menu items, order them, render them in Blade, and automatically highlight the active page for cleaner, more maintainable navigation.

View on GitHub
Deep Wiki
Context7

Laravel Dynamic Menu provides the foundation to build entirely dynamic database powered navigation menus for your web application.

Frequently asked questions about Laravel Dynamic Menu
How do I install Laravel Dynamic Menu in a Laravel app?
Install it with Composer by running composer require rapidwebltd/laravel-dynamic-menu, then run php artisan migrate to create the menu tables. On Laravel releases with package auto-discovery the service provider is registered automatically, but on older 5.x versions you may need to add it to config/app.php. After that you can seed menu records and render them in your Blade templates.
Does Laravel Dynamic Menu support nested sub-menu items?
Yes. The package is designed for structured, nested and sibling-ordered menu content stored in the database rather than hardcoded links. Each set of siblings can be ordered independently, which is what makes multi-level navigation practical. You then render the resulting tree in Blade instead of maintaining a static array of links.
How does automatic active menu item highlighting work?
The package identifies which menu item corresponds to the page currently being viewed so your Blade views can style it as active without manual conditionals. Confirm whether the matching is based on the stored URL or on the current route, and test it on pages with dynamic parameters. If your application uses locale prefixes or non-standard URL structures, verify the highlight behaves as expected before shipping.
Can menu items link to Eloquent models instead of plain URLs?
Yes. Menu items support polymorphic target assignment, so an item can be associated with an arbitrary Eloquent model rather than only a raw URL string. This is useful when navigation points at pages, posts, categories or other existing database records. Because the targets are polymorphic, keep the stored target types stable across refactors and confirm the target columns are nullable in your schema where items have no model attached.
Which Laravel and PHP versions does this package support?
The package states support for Laravel 5.5 through 13 while retaining PHP 7.0 compatibility. That is an unusually wide envelope, so pin the package version in composer.json and run your full application test suite after installing. If you are on PHP 7.0 or Laravel 5.5, validate against your exact framework and database versions rather than relying on the headline support statement.
How do I control the order of menu items?
Items are ordered by position within their sibling group, and this release adds optional explicit decimal positions so you can insert a new item between two existing siblings without renumbering everything. Check how sorting is applied at query time and whether decimal precision is bounded in your schema. Storing positions explicitly is safer than relying on insertion order.
What happens if two menu items share the same position value?
When two siblings have an identical position, the rendered order depends on how the query breaks the tie and is not guaranteed to be stable. Assign distinct positions to any items where order matters, or confirm the tie-breaking behaviour on the same database engine you use in production. This is especially worth testing if you generate positions programmatically.
Do the migrations respect table prefixes and roll back cleanly?
This release corrects rollback table names, which matters for local resets and CI pipelines, particularly when you use table prefixes. Run migrate and migrate:rollback in a disposable environment first and confirm prefixed tables are recognised by the corrected rollback logic. Test on both your development SQLite database and your production MySQL or PostgreSQL engine.
Is upgrading to this version safe, and are there breaking changes?
It is described as a maintenance and compatibility release with no deprecations or breaking API changes, so a standard Composer update followed by running migrations is the expected path. Because rollback behaviour and fresh-install persistence for headings without polymorphic targets were both changed, verify those paths explicitly in your own schema and seed workflow. Also confirm whether any data migration is needed for existing display-order values if you rely on ordering.
When should I use this package instead of a simpler menu solution?
It fits server-rendered Laravel applications using Blade, Eloquent and a relational database that need database-driven, nested menus with ordering and active-page highlighting. It is less suitable when menus are entirely static, where config or Blade-based menu packages are simpler, or when a headless CMS already owns your navigation structures. If you only need code-defined menus, evaluate lighter alternatives before adding a database-backed menu schema.
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.
robertmarney/lara-hierarchial-collections
simonschaufi/rule-doc-generator
emissaoja/emissaoja
blackbricksoftware/gravityforms-civicrm-form-processor
al-rahabi/fancy-crud
jinas/dhivatar-component
mltstephane/laravel-quality
bernskiold/laravel-talentlms
bernskioldmedia/laravel-form-architect
youbar/easy-crud
c-point-labs/laravel-hostyourai
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo