You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+7Lines changed: 7 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -58,6 +58,10 @@ class AdminSidebar extends Menu implements IsMenu
58
58
return $request->query('foo') == 'bars';
59
59
})
60
60
->badge(__('New'), 'text-bg-primary'),
61
+
62
+
MenuItem::make(__('External Link'))
63
+
->url('https://google.com')
64
+
->target('_blank'),
61
65
];
62
66
}
63
67
}
@@ -91,6 +95,7 @@ You may use the following methods to further configure the menu item:
91
95
-`children` - sets the children of the menu item. Note that the default views support only 2 levels of items. If you want more levels or infinite levels, you can supply your own view when rendering the menu.
92
96
-`hideIfNoChildrenVisible` - hides the menu item if it has children but doesn't have any visible children. By default, this option is active for items with blank links.
93
97
-`dontHideIfNoChildrenVisible` - don't hide the menu item even if it has no visible children
98
+
-`target` - sets the `href` target of the menu item
94
99
95
100
### Displaying a Menu
96
101
@@ -164,6 +169,8 @@ $item->getCssClass() // returns the custom css class, if any set for the item
164
169
$item->getAggregatedCount($user) // get the count of the item + the count of all visible child items, will return 0 if the current user can't see the count
165
170
$item->getVisibleCount($user) // get the count of the item, will return 0 if the current user can't see the count
166
171
$item->getVisibleChildren($user) // returns an array of all visible child items
172
+
$item->hasTarget() // checks if the item has a href target value defined
173
+
$item->getTarget() // returns the item's href target attribute value
167
174
```
168
175
169
176
If you want to customize the default views, you can publish the package views and customize them. To publish the view files to `resources/views/vendor/menu-builder`, run:
0 commit comments