F
Filament2mo ago
Zoltar

Navigation Item use isActiveWhen()

i tried to use custom navigation item in my panel
NavigationItem::make('ActivityResource-Index')
->url(fn (): string => ActivityResource::getUrl('index'))
->icon('heroicon-o-presentation-chart-line')
->isActiveWhen(fn () => request()->routeIs(ActivityResource::getRouteBaseName()))
->sort(1),
NavigationItem::make('ActivityResource-Index')
->url(fn (): string => ActivityResource::getUrl('index'))
->icon('heroicon-o-presentation-chart-line')
->isActiveWhen(fn () => request()->routeIs(ActivityResource::getRouteBaseName()))
->sort(1),
Navigation is ok but i cant see active page How do I set isActiveWhen to works correct? thanks
Solution:
Fixed: I use php artisan route:list to see correct view ```php ->isActiveWhen(fn () => request()->routeIs('filament.employee.resources.activities.index'))...
Jump to solution
1 Reply
Solution
Zoltar
Zoltar2mo ago
Fixed: I use php artisan route:list to see correct view
->isActiveWhen(fn () => request()->routeIs('filament.employee.resources.activities.index'))
->isActiveWhen(fn () => request()->routeIs('filament.employee.resources.activities.index'))
Want results from more Discord servers?
Add your server