Laravel Dynamic Menu provides the foundation to build entirely dynamic database powered navigation menus for your web application.
rapidwebltd/laravel-dynamic-menu is a Laravel package for laravel dynamic menu provides the foundation to build entirely dynamic database powered navigation menus for your web application..
It currently has 5 GitHub stars and 258 downloads on Packagist (latest version v1.1.0).
Install it with composer require rapidwebltd/laravel-dynamic-menu.
Discover more Laravel packages by rapidwebltd
or browse all Laravel packages to compare alternatives.
Last updated
This package provides the foundation to build entirely dynamic database powered navigation menus for your web application.
This package requires:
You can install Laravel Dynamic Menu with Composer. Just run the following command.
composer require rapidwebltd/laravel-dynamic-menu
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.
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);