Muetze42 / nova-menu

Heroicon, Font Awesome, SVG & Image Icon for Nova MenuSection, MenuGroup & MenuItem. And new features like Cards, Iframe, Filter.
https://novapackages.com/packages/norman-huth/nova-menu
19 stars 4 forks source link

Some of the items don't work #52

Closed nikoo-eshratabadi closed 4 months ago

nikoo-eshratabadi commented 5 months ago

Laravel Version: 10.10 Nova Version: 4.25.1 PHP Version: 8.1.23

hello thank you for the great package I followed the required steps. before i was using digital-creative/collapsible-resource-manager but i have removed it and installed your package instead. unfortunately MenuSection and MenuItems don't work. this piece of code only shows test3 and test 4

use Laravel\Nova\Menu\Menu;
use NormanHuth\NovaMenu\MenuCard;
use NormanHuth\NovaMenu\MenuSection;
use NormanHuth\NovaMenu\MenuGroup;
use NormanHuth\NovaMenu\MenuItem;
use NormanHuth\NovaMenu\MenuDisclosure;

public function boot(){
        parent::boot();

        Nova::mainMenu(function (Request $request) {
            return [
                MenuSection::make(__('Test1'), [])
                    ->icon('chart-bar'),
                MenuGroup::make(__('Test2'), [])
                    ->icon('chart-bar'),
                MenuItem::resource(User::class)
                    ->icon('chart-bar'),
                MenuDisclosure::make(__('Test3'), [])
                    ->icon('chart-bar'),
                MenuCard::make()
                    ->content('Test4'),
            ];
        }); 
}

A115CF30-8562-4010-AC0D-9F5FA43C9097_1_201_a

Muetze42 commented 5 months ago

Works perfectly

Tested: https://github.com/muetzes-devspace/nova-menu-issues-52/blob/main/app/Providers/NovaServiceProvider.php

The behavior of the elements is exactly the same as in Nova. If they have no content, they are not displayed.

The MenuDisclosure element is intended more for the user menu, so that you also have a menu there that is collapsible.

nikoo-eshratabadi commented 4 months ago

hello @Muetze42 thanks for the reply i couldn't open the link you shared but it is working now i just used this in the MenuSection (MenuItem::make('Users'))->path('/resources/users')->icon('users')

and worked but i had already tried MenuItem::resource(User::class),