F
Filamentβ€’12mo 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β€’12mo ago
->openInNewTab() to the item I beleive? Or ->extraAttributes(['target' => '_blank'])
Babul
BabulOPβ€’12mo 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β€’12mo 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
BabulOPβ€’12mo 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β€’12mo ago
Ahhh Please feel free to do a PR to V3 docs πŸ™‚
Babul
BabulOPβ€’12mo ago
Agreed! I'll add it to my list. πŸ˜„
Want results from more Discord servers?
Add your server