F
Filamentβ€’7mo ago
Babul

How do I add this link to my dashboard?

I want to add a link to the left hand menu of my Dashboard which directs the user outside of Filament. Much appreciated - feeling dense right now πŸ˜…
No description
6 Replies
toeknee
toekneeβ€’7mo ago
->openInNewTab() to the item I beleive? Or ->extraAttributes(['target' => '_blank'])
Babul
Babulβ€’7mo ago
What I did was create a Pages\UserDashboard.php which pointed to a blade, which had the link. But that is two clicks instead of one. Was hoping to have a one-click solution. For now, I moved those links to my panel() and added ->userMenuItems([]) which works for this app. Would still like to know if its possible to create a direct link in the left menu.
toeknee
toekneeβ€’7mo ago
Of course it is, I explained how to above? With actual code:
Filament::registerNavigationItems([
// Horizon - Queue Worker
NavigationItem::make('Horizon')
->url('/horizon')
->openUrlInNewTab()
->icon('heroicon-o-beaker')
->group('System')
]);
Filament::registerNavigationItems([
// Horizon - Queue Worker
NavigationItem::make('Horizon')
->url('/horizon')
->openUrlInNewTab()
->icon('heroicon-o-beaker')
->group('System')
]);
In you a service provider
Babul
Babulβ€’7mo ago
Thank you so much! That's exactly what I was looking for. Its in the v2 docs, but not v3. I knew I had done it previously but couldn't remember. For anyone else who finds this, here is the doc link: https://filamentphp.com/docs/2.x/admin/navigation#registering-custom-navigation-items And this does work in v3
toeknee
toekneeβ€’7mo ago
Ahhh Please feel free to do a PR to V3 docs πŸ™‚
Babul
Babulβ€’7mo ago
Agreed! I'll add it to my list. πŸ˜„