Navigation Groups in F4
Hi everyone,
I’m working with Filament 4 and I want to control the order of navigation groups in the sidebar. I noticed there’s a property called:
protected static ?int $navigationGroupSort = 2;
However, I’m not sure how it works exactly or what the best way is to use it for sorting multiple groups. Can anyone explain how to properly sort navigation groups in Filament 4 or share an example?
Thanks in advance!
Solution:Jump to solution
you can sort navigation group from panel provider file
$panel
->navigationGroups([
'Shop',...
2 Replies
Solution
you can sort navigation group from panel provider file
$panel
->navigationGroups([
'Shop',
'Blog',
'Settings',
])
or if you have defined using Class
$panel
// ...
->navigationGroups([
NavigationGroup::make()
->label('Shop')
->icon('heroicon-o-shopping-cart'),
NavigationGroup::make()
->label('Blog')
->icon('heroicon-o-pencil'),
NavigationGroup::make()
->label(fn (): string => __('navigation.settings'))
->icon('heroicon-o-cog-6-tooth')
->collapsed(),
]);
it will sort it accordingly
Thanks a lot