outl1ne / nova-settings

A Laravel Nova tool for editing custom settings using native Nova fields.
MIT License
271 stars 99 forks source link

How to add Nova Settings to Nova menu? #148

Closed makkinga closed 1 year ago

makkinga commented 1 year ago

Using Nova::mainMenu(), what would be the best way to add Nova Settings? If possible at all.

I've tried adding this with no success:

MenuItem::resource(\Outl1ne\NovaSettings\Nova\Resources\Settings::class)
mstaack commented 1 year ago
MenuSection::make('Settings')->path('/nova-settings/general')->icon('adjustments'),
makkinga commented 1 year ago
MenuSection::make('Settings')->path('/nova-settings/general')->icon('adjustments'),

Thanks! That works 👍🏻
For anyone needing this solution for multiple settings pages you need to specify the specific URL:

MenuSection::make(__('Settings'), [
    MenuItem::make(__('Opening hours'))->path('/nova-settings/opening-hours'),
    MenuItem::make(__('Company information'))->path('/nova-settings/company-information'),
])->icon('adjustments')->collapsable()