orchidsoftware / crud

Simplify the process of building CRUD (Create, Read, Update, Delete) functionality in Laravel using the features of Orchid.
https://orchid.software
MIT License
137 stars 34 forks source link

Moving to other navigation dropdown #97

Closed AlizHarb closed 3 months ago

AlizHarb commented 3 months ago

Hello i was trying to move the resource to other navigation dropdown but did not get work, will appreciate if you can help.

Menu::make(__('Game Mechanics')) ->icon('bs.gamepad') ->list([ Menu::make(__('Ranks')) ->icon('bs.dash') ->route('platform.resource.rank') ->permission('admin.games.ranks'), ]),

` /**

tabuna commented 3 months ago

Hi! You were almost there. The only issue in the code is the resource link. It should be, for example, like this: route('platform.resource.list', UserResource::uriKey()). Here’s the complete, corrected example:

Menu::make(__('Game Mechanics'))
    ->icon('bs.gamepad')
    ->list([
        Menu::make(__('Ranks'))
            ->icon('bs.dash')
            ->route('platform.resource.list', YouClass::uriKey()) // Replace
            ->permission('admin.games.ranks'),
    ]);