Skip to content

Commit 5fce7af

Browse files
authored
Update menu-bar.md
1 parent 6db2a35 commit 5fce7af

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

resources/views/docs/1/the-basics/menu-bar.md

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -230,23 +230,28 @@ You may add a context menu to your menu bar icon. This context menu will be show
230230

231231
![Menu Bar Context Menu](/img/docs/menubar-context-menu.png)
232232

233-
To add a context menu, you may use the `contextMenu()` method on the `MenuBar`.
234-
This method accepts a `Native\Laravel\Menu\Menu` instance.
233+
To add a context menu to your Menu Bar app, you may use the `withContextMenu()` method on the `MenuBar`.
235234

236-
To learn more about the menu builder, please refer to the [Menu Builder](/docs/the-basics/menu-builder) documentation.
235+
This method accepts a `Native\Laravel\Menu\Menu` instance, which can be created using the `Menu::make()` method of the `Menu` facade.
237236

238237
```php
238+
use Native\Laravel\Facades\Menu;
239+
239240
MenuBar::create()
240241
->withContextMenu(
241-
Menu::new()
242-
->label('My Application')
243-
->separator()
244-
->link('https://nativephp.com', 'Learn more…')
245-
->separator()
246-
->quit()
242+
Menu::make(
243+
Menu::label('My Application'),
244+
Menu::separator(),
245+
Menu::link('https://nativephp.com', 'Learn more…')
246+
->openInBrowser(),
247+
Menu::separator(),
248+
Menu::quit()
249+
)
247250
);
248251
```
249252

253+
To learn more about the `Menu` facade, please refer to the [Application Menu](/docs/the-basics/application-menu) documentation.
254+
250255
## Events
251256

252257
NativePHP provides a simple way to listen for menu bar events.

0 commit comments

Comments
 (0)