Creating a Menu
Use a migration or seeder to add each menu to the database, and optionally add the initial menu items. For example:
$menu = Menu::create([
'code' => 'top-menu',
'name' => 'Top menu',
]);
$home = $menu->menuItems()->create([
'position' => 0,
'type' => MenuType::Link,
'title' => 'Home',
'url' => route('home'),
]);
$menu->menuItems()->create([
'ancestor_id' => $home->id,
'position' => 0,
'type' => MenuType::Link,
'title' => 'About',
'url' => route('about'),
]);
Add the menu to the relevant Blade template:
{{ render_menu('top-menu') }}
Repeat this for each menu that is required.
Note: The default template is Bootstrap-compatible; however (1) you will need to add the relevant JavaScript to handle dropdowns, and (2) out of the box, Bootstrap doesn't support nested dropdowns (more than 2 levels).
To customise the HTML, run:
scripts/artisan.sh vendor:publish --tag=nexus-menus-views
Then modify the Blade templates in resources/views/vendor/nexus-menus/.