How to add a custom 'CreateRecord Page' to the sidebar navigation?

If I use
->navigation(function (NavigationBuilder $builder): NavigationBuilder {
return $builder->items([...]);
});
->navigation(function (NavigationBuilder $builder): NavigationBuilder {
return $builder->items([...]);
});
I am replacing the default navigation items, including those that are added through plugins. Is there a method I can use with$builder->items([...this_method_calls_default_nav_items()...]) so that I can retrieve the default navigation items?
4 Replies
Lara Zeus
Lara Zeus14mo ago
this is in the panel provider? why not add items:
->navigationItems([
NavigationItem::make('Analytics')
->url('https://filament.pirsch.io', shouldOpenInNewTab: true)
->icon('heroicon-o-presentation-chart-line')
->group('Reports')
->sort(3),
// ...
])
->navigationItems([
NavigationItem::make('Analytics')
->url('https://filament.pirsch.io', shouldOpenInNewTab: true)
->icon('heroicon-o-presentation-chart-line')
->group('Reports')
->sort(3),
// ...
])
Positiverain
PositiverainOP14mo ago
When I use navigationItems() as in
$panel->navigationItems([
NavigationItem::make("navItem")
->url(TicketResource::getUrl('issue'))
])
$panel->navigationItems([
NavigationItem::make("navItem")
->url(TicketResource::getUrl('issue'))
])
I get Call to a member function getId() on null Error. same NavigationItem used in $panel->navigation(NavigationBuilder $builder) works as intended
Lara Zeus
Lara Zeus14mo ago
use ->url(fn (): string => TicketResource::getUrl('issue'))
Positiverain
PositiverainOP14mo ago
Thanks
Want results from more Discord servers?
Add your server