WebKenth
WebKenth
FFilament
Created by WebKenth on 10/6/2023 in #❓┊help
Target Class [cache] does not exist
Wondering how we can "fix" this the correct way I don't mind having the logic moved, but it seems like a bug not being able to do translations in a service provider when the panel's configuration is being set there
6 replies
FFilament
Created by WebKenth on 10/6/2023 in #❓┊help
Target Class [cache] does not exist
I was able to move my logic into a Page Although now the page is responsible for the entire "recently viewed" section of the navigation I added my logic to a Custom page and overwrote the: getNavigationItems function I kept the original Page NavigationItem and just added my own array afterwards Still need to clean it up abit, but no missing Cache class anymore 😛
/**
* @return array<NavigationItem>
*/
public static function getNavigationItems(): array
{
$navigationItems = [
\Filament\Navigation\NavigationItem::make(static::getNavigationLabel())
->group(static::getNavigationGroup())
->icon(static::getNavigationIcon())
->activeIcon(static::getActiveNavigationIcon())
->isActiveWhen(fn (): bool => request()->routeIs(static::getRouteName()))
->sort(static::getNavigationSort())
->badge(static::getNavigationBadge(), color: static::getNavigationBadgeColor())
->url(static::getNavigationUrl()),
];

$recently_viewed = session()->get('recently_visited', []);
foreach ($recently_viewed as $key => $item) {
$navigationItems[] = \Filament\Navigation\NavigationItem::make('dashboard_' . $key)
->label(fn (): string => $item['name'])
->url(fn (): string => '')
->group('Recently Viewed');
}
return $navigationItems;
}
/**
* @return array<NavigationItem>
*/
public static function getNavigationItems(): array
{
$navigationItems = [
\Filament\Navigation\NavigationItem::make(static::getNavigationLabel())
->group(static::getNavigationGroup())
->icon(static::getNavigationIcon())
->activeIcon(static::getActiveNavigationIcon())
->isActiveWhen(fn (): bool => request()->routeIs(static::getRouteName()))
->sort(static::getNavigationSort())
->badge(static::getNavigationBadge(), color: static::getNavigationBadgeColor())
->url(static::getNavigationUrl()),
];

$recently_viewed = session()->get('recently_visited', []);
foreach ($recently_viewed as $key => $item) {
$navigationItems[] = \Filament\Navigation\NavigationItem::make('dashboard_' . $key)
->label(fn (): string => $item['name'])
->url(fn (): string => '')
->group('Recently Viewed');
}
return $navigationItems;
}
6 replies
FFilament
Created by vermelen37 on 9/19/2023 in #❓┊help
Whats the problem here
right click => inspect element on the menu check that no CSS has been injected that touches your navigation
7 replies
FFilament
Created by WebKenth on 9/18/2023 in #❓┊help
Custom numbering of labels using Builder
No description
3 replies