Replies: 2 comments
-
|
This would be awesome to have! If anyone has an idea how to accomplish this, that would be great! |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Has anyone found a solution? I found two ways to add an item to the menu. The first one adds the menu item to the end of the menu, while the second one adds the menu item to a specific position, but it's not optimized. I'll share the first one. Menu::macro('main', function () {
$menu = Menu::new()->add() //your menu items.
Event::dispatch('menu.building', $menu);
$menu->setActiveFromRequest();
return $menu;
});in the plugin service provider Event::listen('menu.building', function ($menu) {
$menu->add() //add new menu items.
}); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I installed and added a menu in one of my applications. I add the menu from a Blade Component. I have a number of packages and I want to add items to the same menu if they are installed.
Example Case
I created a
Top Navmenu as Blade Component. I have aBlogpackage. If I install that package a menu item needs to be displayed inTop Navwhich I created earlier.Is is possible to add items to menus from multiple places? if so, how can I do that?
Beta Was this translation helpful? Give feedback.
All reactions