Skip to content

Admin Dashboard Widgets

Capell Admin uses Filament dashboard widgets for product status, content activity, and editor work queues. Widgets are registered through CapellAdmin::registerDashboardWidget() and rendered by CapellDashboard.

Dashboard enumWhen it is used
DashboardEnum::MainNormal installed admin dashboard at /admin.
DashboardEnum::NotInstalledEmpty/setup dashboard state when Admin is not installed yet or no site exists.
DashboardEnum::SystemHealthReserved for system-health style dashboard integrations.

The current normal Admin package ships one main dashboard page: Capell\Admin\Filament\Pages\CapellDashboard.

Admin registers these main dashboard widgets from AdminServiceProvider and CapellAdminPlugin:

WidgetPurpose
SiteStatsOverviewWidgetSite-level summary metrics.
AbstractCapellInfoWidgetCapell/package information.

The dashboard also includes Filament’s FilamentInfoWidget.

Resource pages can have their own alert widgets, such as page, site, type, language, and theme alerts. Those live on the resource screens rather than the dashboard.

Dashboard settings live under Settings -> Dashboard. The settings schema is DashboardSettingsSchema.

Toggles are discovered from:

  1. Widget classes registered with CapellAdmin::registerDashboardWidget().
  2. Legacy/default widget enum values.
  3. Package contributors tagged with DashboardSettingsContributor::TAG.

SyncDashboardWidgetSettingsAction repairs missing default keys and can re-enable defaults if all known defaults were accidentally disabled.

The built-in tuning values are:

SettingPurpose
my_work_queue_limitNumber of editor work-queue entries.
recently_published_limitNumber of recently published entries.
ai-orchestrator_spend_window_daysLookback window for ai-orchestrator spend aggregates when that feature is installed.

Register the widget from your package service provider:

<?php
declare(strict_types=1);
namespace Vendor\Package\Providers;
use Capell\Admin\Enums\DashboardEnum;
use Capell\Admin\Facades\CapellAdmin;
use Vendor\Package\Filament\Widgets\MyPackageWidget;
final class PackageServiceProvider
{
public function boot(): void
{
CapellAdmin::registerDashboardWidget(MyPackageWidget::class, DashboardEnum::Main);
}
}

If the widget should appear in Settings, add a settings key to the widget class if it supports that convention, or contribute the key through a tagged DashboardSettingsContributor.

<?php
declare(strict_types=1);
namespace Vendor\Package\Admin;
use Capell\Admin\Contracts\DashboardSettingsContributor;
final class PackageDashboardSettingsContributor implements DashboardSettingsContributor
{
public function settingsKeys(): array
{
return [
[
'key' => 'my_package_widget',
'label' => 'My package widget',
'group' => 'Package',
],
];
}
}

Tag the contributor in the container:

$this->app->tag([PackageDashboardSettingsContributor::class], DashboardSettingsContributor::TAG);

Use unique keys. If two contributors return the same key, the later-loaded contributor wins.

FilePurpose
packages/admin/src/Filament/Pages/CapellDashboard.phpDashboard page and filters.
packages/admin/src/Support/CapellAdminManager.phpDashboard widget registry.
packages/admin/src/Enums/DashboardEnum.phpDashboard buckets.
packages/admin/src/Filament/Settings/Schemas/DashboardSettingsSchema.phpDashboard settings UI.
packages/admin/src/Actions/SyncDashboardWidgetSettingsAction.phpDefault settings repair/sync.
packages/admin/src/Contracts/DashboardSettingsContributor.phpPackage settings contribution contract.