rapidwebltd / laravel-dynamic-menu
Laravel Dynamic Menu provides the foundation to build entirely dynamic database powered navigation menus for your web application.
Package info
github.com/rapidwebltd/laravel-dynamic-menu
pkg:composer/rapidwebltd/laravel-dynamic-menu
Requires
- php: >=7.0
- illuminate/database: ^5.5 || ^6.0 || ^7.0 || ^8.0 || ^9.0 || ^10.0 || ^11.0 || ^12.0 || ^13.0
- illuminate/support: ^5.5 || ^6.0 || ^7.0 || ^8.0 || ^9.0 || ^10.0 || ^11.0 || ^12.0 || ^13.0
Requires (Dev)
- phpunit/phpunit: ^6.5 || ^9.6 || ^12.0
This package is auto-updated.
Last update: 2026-07-18 08:55:02 UTC
README
This package provides the foundation to build entirely dynamic database powered navigation menus for your web application.
Requirements
This package requires:
- PHP 7.0 or above
- Laravel 5.5 through 13
Installation
You can install Laravel Dynamic Menu with Composer. Just run the following command.
composer require rapidwebltd/laravel-dynamic-menu
Setup
This package comes with various database migrations. To create the required tables, run the following Artisan command.
php artisan migrate
Laravel discovers the service provider automatically. The package retains its PHP 7.0 minimum while Composer selects a compatible framework version.
Adding menu items
Create a menu and add root or nested items with automatic sibling ordering.
$menu = new \RapidWeb\LaravelDynamicMenu\Models\Menu(); $menu->name = 'Main navigation'; $menu->save(); $home = $menu->add('Home', $homePage); $menu->add('Contact', $contactPage); $home->add('Overview', $overviewPage);
The optional final argument sets an explicit decimal display order. Items without a linked model are also supported and return an empty URL, which is useful for headings and nested groups.
$heading = $menu->add('Products'); $featured = $menu->add('Featured', $featuredPage, 0, 0.5);