F
Filament2y ago
xy

Chart appearing on Panel

I have a new chart widget in App\Filament\App\Widgets which I am using via the getHeaderWidgets method on a page. The problem I'm having is that this chart is now appearing on the main panel dashboard also. Is there a way to exclude it from the dashboard? The widget is not referenced in AppPanelProvider under widgets.
7 Replies
pechtelt
pechtelt2y ago
Can you show your AppPanelProvider?
xy
xyOP2y ago
public function panel(Panel $panel): Panel
{
return $panel
->id('app')
->path('app')
->login()
->profile()
->registration()
->passwordReset()
->emailVerification()
->colors([
'primary' => Color::Green,
])
->discoverResources(in: app_path('Filament/App/Resources'), for: 'App\\Filament\\App\\Resources')
->discoverPages(in: app_path('Filament/App/Pages'), for: 'App\\Filament\\App\\Pages')
->pages([
Pages\Dashboard::class,
])
->discoverWidgets(in: app_path('Filament/App/Widgets'), for: 'App\\Filament\\App\\Widgets')
->widgets([
AppInfoWidget::class,
OverlookWidget::class,
AppStatsOverviewWidget::class,
])
->middleware([
EncryptCookies::class,
AddQueuedCookiesToResponse::class,
StartSession::class,
AuthenticateSession::class,
ShareErrorsFromSession::class,
VerifyCsrfToken::class,
SubstituteBindings::class,
DisableBladeIconComponents::class,
DispatchServingFilamentEvent::class,
])
->authGuard('web')
->authMiddleware([
Authenticate::class,
])
->plugins([
BreezyCore::make()->myProfile()->enableTwoFactorAuthentication(),
QuickCreatePlugin::make(),
])->globalSearchKeyBindings(['command+k', 'ctrl+k'])->collapsibleNavigationGroups();
}
public function panel(Panel $panel): Panel
{
return $panel
->id('app')
->path('app')
->login()
->profile()
->registration()
->passwordReset()
->emailVerification()
->colors([
'primary' => Color::Green,
])
->discoverResources(in: app_path('Filament/App/Resources'), for: 'App\\Filament\\App\\Resources')
->discoverPages(in: app_path('Filament/App/Pages'), for: 'App\\Filament\\App\\Pages')
->pages([
Pages\Dashboard::class,
])
->discoverWidgets(in: app_path('Filament/App/Widgets'), for: 'App\\Filament\\App\\Widgets')
->widgets([
AppInfoWidget::class,
OverlookWidget::class,
AppStatsOverviewWidget::class,
])
->middleware([
EncryptCookies::class,
AddQueuedCookiesToResponse::class,
StartSession::class,
AuthenticateSession::class,
ShareErrorsFromSession::class,
VerifyCsrfToken::class,
SubstituteBindings::class,
DisableBladeIconComponents::class,
DispatchServingFilamentEvent::class,
])
->authGuard('web')
->authMiddleware([
Authenticate::class,
])
->plugins([
BreezyCore::make()->myProfile()->enableTwoFactorAuthentication(),
QuickCreatePlugin::make(),
])->globalSearchKeyBindings(['command+k', 'ctrl+k'])->collapsibleNavigationGroups();
}
pechtelt
pechtelt2y ago
What is the name of your widget meantion in the getHeaderWidgets method?
xy
xyOP2y ago
AccountHistoryChart
pechtelt
pechtelt2y ago
You should put them in a different directory, anything in app\Filament\Widgets will be automatically loaded on the dashboard.
xy
xyOP2y ago
Ok, thanks
pechtelt
pechtelt2y ago
For yourself so you can get through faster next time, if you look up your question in the help section before asking it you can often find the answer: #How to render only selected widgets/tables on the dashboard

Did you find this page helpful?