F
Filament17mo 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
pechtelt17mo ago
Can you show your AppPanelProvider?
xy
xyOP17mo 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
pechtelt17mo ago
What is the name of your widget meantion in the getHeaderWidgets method?
xy
xyOP17mo ago
AccountHistoryChart
pechtelt
pechtelt17mo ago
You should put them in a different directory, anything in app\Filament\Widgets will be automatically loaded on the dashboard.
xy
xyOP17mo ago
Ok, thanks
pechtelt
pechtelt17mo 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
Want results from more Discord servers?
Add your server