setting url of custom navigation item

I have a custom navigation item:
$items[] = NavigationItem::make('Reports')
->icon('heroicon-o-document-text')
->group($selectedLocation->name)
->isActiveWhen(fn (): bool => request()->routeIs('filament.app.pages.reports*'))
->url(Reports::getUrl());
$items[] = NavigationItem::make('Reports')
->icon('heroicon-o-document-text')
->group($selectedLocation->name)
->isActiveWhen(fn (): bool => request()->routeIs('filament.app.pages.reports*'))
->url(Reports::getUrl());
The url for this is app/1/reports, but this item only shows up after a location is selected, and I want the location reflected in the url as well. So I'd like to have app/1/locations/4/reports. I tried adding parameters to the geturl method, but it just adds them as query parameters, so not really what I'm after. There's another custom navigation item in the menu that links to a resource class, and that works like I'd expect with no changes. Reports is a custom page though, and I'm unsure of what changes I would need to make to have it function similarly.
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server