Admin Extensions
Packages extend the admin through CapellAdmin, admin bridges, tagged contracts, settings contributors, and Filament classes.
Stable Admin zones
Section titled “Stable Admin zones”Capell exposes deliberately small, typed Admin composition zones. Stable zones cover Page edit content/actions/header widgets, Page list table columns, and the Extensions dashboard’s content before/after the table, header actions/widgets, table columns/filters, and record actions:
use Capell\Admin\Data\AdminZoneContributionData;use Capell\Admin\Enums\AdminZone;use Capell\Core\Support\Extensions\ExtensionPosition;use Filament\Tables\Columns\TextColumn;
$registrar->zone(new AdminZoneContributionData( zone: AdminZone::PageListTableColumns, key: 'acme.pages.reference-column', resolver: static fn (): array => [TextColumn::make('reference')], position: ExtensionPosition::after('capell-admin.pages.list.table.columns'), permission: 'view_any_page', owner: 'acme/example', source: AcmeAdminBridge::class,));The contribution key is scoped to its zone and must be unique. Contributions
are resolved through the shared extension ordering policy, then filtered by
permission and visibility before their typed values are rendered. Existing
PageTableExtender implementations remain compatible, but their columns are
appended after this stable pipeline and cannot participate in stable-key
ordering.
The legacy PageEditExtender and ExtensionsPageExtender contracts remain
compatible as explicit post-zone fallback paths. New package code should
prefer AdminZoneContributionData so actions, widgets, filters, and table
values can declare relative positions, permissions, and visibility. Zones only
exist where the current screen has a corresponding Filament seam; sidebar
locations remain outside this vocabulary rather than being silently implied.
Admin Bridges
Section titled “Admin Bridges”Use an admin bridge when a package contributes more than one admin concern. The bridge keeps package wiring in one class and lets Capell boot the package’s admin surface once.
use Capell\Admin\Contracts\Bridges\AdminBridge;use Capell\Admin\Data\Bridges\AdminBridgeContextData;use Capell\Admin\Support\Bridges\AdminBridgeRegistrar;
final class ExampleAdminBridge implements AdminBridge{ public function register(AdminBridgeRegistrar $registrar, AdminBridgeContextData $context): void { $registrar->resource(ExampleResource::class, group: 'content', name: 'examples'); $registrar->page(ExampleReportPage::class); $registrar->filamentDashboardWidget(ExampleHealthWidget::class, DashboardEnum::SystemHealth); $registrar->settingsClass('example', ExampleSettings::class); $registrar->settingsSchema('example', ExampleSettingsSchema::class); }}Register the bridge from the package admin provider:
CapellAdmin::registerAdminBridge('capell-app/example', ExampleAdminBridge::class);CapellAdmin::bootAdminBridges('capell-app/example');For one small contribution, direct CapellAdmin::contributeToAdminSurface(...) calls are still acceptable. Prefer a bridge when the package adds a resource plus settings, widgets, extenders, or user menu actions.
Register package pages through an admin bridge or directly with AdminSurfaceContributionData::page(...):
use Capell\Admin\Data\AdminSurfaceContributionData;
CapellAdmin::contributeToAdminSurface( AdminSurfaceContributionData::page(ExampleReportPage::class),);The page class should provide translated navigation labels:
public static function getNavigationLabel(): string{ return __('capell-example::navigation.example_report');}If the page is the package’s main settings or control page, register it as the extension page:
CapellAdmin::registerExtensionPage('capell-app/example', ExampleSettingsPage::class);This registers the Filament page and lists the package on the Extensions management page with a direct Edit action. Extension pages do not keep their own direct sidebar item; Capell automatically adds accessible registered extension pages to the grouped Filament sub-navigation on the Extensions page.
Resources
Section titled “Resources”Register resources when the package owns a model:
use Capell\Admin\Data\AdminSurfaceContributionData;
CapellAdmin::contributeToAdminSurface( AdminSurfaceContributionData::resource(ExampleResource::class, group: 'content', name: 'examples'),);The group and name pair is the lookup slot other package code can use through CapellAdmin::getResource($group, $name). Use a stable name instead of relying on class names when a package wants to replace or extend a known resource slot.
Dashboard Widgets
Section titled “Dashboard Widgets”Use dashboard slots rather than hardcoded admin registration:
CapellAdmin::registerDashboardFilamentWidget(ExampleHealthWidget::class, DashboardEnum::SystemHealth);Widgets should implement Capell\Admin\Contracts\CapellFilamentWidgetContract when they participate in Capell dashboard settings.
User Menu Items
Section titled “User Menu Items”Use the user menu registry for admin-only package shortcuts and attention counts:
CapellAdmin::registerUserMenuItem( key: 'capell-example.notes', label: fn (): string => __('capell-example::user-menu.notes'), url: fn (): string => route('filament.admin.pages.example-notes'), badge: fn (): int => ExampleNote::query()->unread()->count(), sort: 40,);See User Menu Registry for the full API, badge rules, and translated package examples.
Welcome Tour Steps
Section titled “Welcome Tour Steps”Packages can add onboarding steps to the Capell admin welcome tour:
CapellAdmin::registerWelcomeTourStep( key: 'capell-example.feature', title: __('capell-example::welcome.feature_title'), description: __('capell-example::welcome.feature_description'), element: '.capell-example-feature', sort: 80,);Use stable admin-only selectors for element. Omit element for a modal step. The tour is shown on the admin dashboard and can be enabled or disabled per user from the user form.
Dashboard Settings
Section titled “Dashboard Settings”Packages that add widgets should register them through registerDashboardFilamentWidget() and make sure Admin settings can expose their toggles. Small counters that belong inside the Capell overview widget should use registerOverviewStat() instead of a standalone widget.
For package settings screens, use SettingsSchemaRegistry directly or the bridge registrar helpers:
$registrar->settingsClass('example', ExampleSettings::class);$registrar->settingsSchema('example', ExampleSettingsSchema::class);$registrar->settingsMetadata(new SettingsGroupMetadata( group: 'example', label: 'capell-example::settings.label',));Settings pages can extend AbstractPackageSettingsPage and use SettingsGroupMetadata for their page label, icon, and sort.
Form And Table Extenders
Section titled “Form And Table Extenders”Use tagged extenders when adding fields or actions to core resources:
$this->app->tag([ExamplePageSchemaExtender::class], PageSchemaExtender::TAG);Common tags:
| Need | Tag or registry |
|---|---|
| Page form fields, tabs, sidebar components, relation managers | PageSchemaExtender::TAG |
| Site form fields, tabs, create wizard fields, relation managers | SiteSchemaExtender::TAG |
| Layout tabs and relation managers | LayoutSchemaExtender::TAG |
| User fields, lifecycle, relation managers, and table additions | UserResourceBridge::TAG |
| Page table columns, filters, bulk actions, query changes | PageTableExtender::TAG |
| Page header actions | PageHeaderActionExtender::TAG |
| Site header actions | SiteHeaderActionExtender::TAG |
| Site table row actions | SiteRecordActionExtender::TAG |
| Header actions on arbitrary resource pages | ResourceHeaderActionExtender::TAG |
| Page title/slug field actions or after-label schema | PageTitleWithSlugInputExtender::TAG |
| Page edit form actions or header widgets | PageEditExtender::TAG |
| Page/site export modal fields and options | PageExportExtender::TAG |
| Publish panel sections | PublishPanelExtender::TAG |
| Media edit header actions | MediaEditActionExtender::TAG |
| Extensions page status content | ExtensionsPageExtender::TAG |
| Filament panel configuration | AdminPanelExtender::TAG |
| Admin header tools | AdminToolItem::TAG |
Prefer extenders over modifying admin resources directly.
Use the abstract schema extenders when possible:
AbstractPageSchemaExtenderAbstractSiteSchemaExtenderAbstractUserResourceBridge
They provide no-op defaults so a package only overrides the hooks it needs. See Schema Hooks for method signatures, hook enums, and resolver debugging.
Configurators
Section titled “Configurators”Configurators shape an existing Capell editing surface: blueprints, pages, sites, languages, layouts, and themes. A configurator implements Capell\Admin\Contracts\ConfiguratorInterface with a stable getKey(), a getSort() order, and a configure() method that returns a Filament Schema.
Register configurators from an admin bridge:
use Capell\Admin\Enums\ConfiguratorTypeEnum;
$registrar->configurator( ExampleSiteConfigurator::class, group: ConfiguratorTypeEnum::Site->value, name: ExampleSiteConfigurator::getKey(),);Keep configurators thin: assemble Filament components there, put domain work in Actions, and keep visible text in translations. Wrap normal fields in contained Section components, the same presentation rule as settings schemas. Use package settings schemas for package-level configuration; use configurators only to extend an existing editing surface.
Page Table Status
Section titled “Page Table Status”The main Pages table renders one core publish/workflow status column. Admin owns the column layout; packages that provide workflow semantics should replace the resolver instead of adding a competing status column.
Bind Capell\Admin\Contracts\Pages\PageTableStatusResolver from the package admin provider:
use Capell\Admin\Contracts\Pages\PageTableStatusResolver;use Capell\Admin\Data\Pages\PageTableStatusData;use Capell\Core\Models\Page;use Filament\Support\Icons\Heroicon;use Illuminate\Database\Eloquent\Builder;
$this->app->singleton(PageTableStatusResolver::class, ExampleWorkflowPageStatusResolver::class);
final class ExampleWorkflowPageStatusResolver implements PageTableStatusResolver{ /** * @param Builder<Page> $query * @return Builder<Page> */ public function modifyQuery(Builder $query): Builder { return $query->with('latestWorkflowStep'); }
public function resolve(Page $page): PageTableStatusData { return new PageTableStatusData( label: __('capell-example::workflow.awaiting_review'), shortLabel: __('capell-example::workflow.review_short'), tooltip: __('capell-example::workflow.awaiting_review_tooltip'), color: 'info', icon: Heroicon::OutlinedClipboardDocumentCheck, ); }}Core falls back to publish-date states: deleted, expired, scheduled, and published. Approval, draft, rollback, and workspace states belong in workflow packages through this resolver.
Extensions Dashboard
Section titled “Extensions Dashboard”/admin/extensions is the Extensions dashboard. Keep package management pages in the Filament left sub-navigation by registering them with CapellAdmin::registerExtensionPage($packageName, PageClass::class).
Use dashboard Filament widgets for operational package status, health checks, shortcuts, and marketplace-style actions that belong on the overview. Register widgets against the Extensions dashboard scope:
use Capell\Admin\Enums\DashboardEnum;use Capell\Admin\Facades\CapellAdmin;
CapellAdmin::registerDashboardFilamentWidget( ExampleExtensionHealthFilamentWidget::class, DashboardEnum::Extensions,);Admin bridges can use the convenience method:
$registrar->extensionDashboardFilamentWidget(ExampleExtensionHealthFilamentWidget::class);Every extension dashboard Filament widget must use a globally unique settingsKey(), preferably package-prefixed, so dashboard customisation can enable, disable, reorder, and resize it without colliding with core widgets.
Extension dashboard Filament widgets may implement Capell\Admin\Contracts\Extensions\ExtensionDashboardFilamentWidgetContract when they want to expose their package-author metadata explicitly. The contract defines the widget settings key, label, description, default span, default order, dashboard scope, and canView() gate. Existing CapellFilamentWidgetContract widgets remain supported; the contract is for packages that want their dashboard contribution to be self-describing.
Packages can also contribute operation data without coupling to the Filament UI. Register providers from an admin bridge:
$registrar->extensionHealthProvider(ExampleHealthProvider::class);$registrar->extensionRuntimeCheckProvider(ExampleRuntimeProvider::class);$registrar->extensionQuickActionProvider(ExampleQuickActionProvider::class);$registrar->extensionUpdateMetadataProvider(ExampleUpdateProvider::class);$registrar->extensionDependencyProvider(ExampleDependencyProvider::class);Provider contracts live in Capell\Admin\Contracts\Extensions:
| Contract | Use |
|---|---|
ExtensionHealthProvider | Adds package health alerts to the diagnostics surface. |
ExtensionRuntimeCheckProvider | Adds runtime compatibility checks such as queues, cache stores, services, or package-specific gates. |
ExtensionQuickActionProvider | Adds safe package-level operational shortcuts. Keep destructive work permission-gated. |
ExtensionUpdateMetadataProvider | Supplies update readiness states when metadata comes from a package or marketplace integration. |
ExtensionDependencyProvider | Adds uninstall, disable, or update blockers beyond Capell core package protection. |
Core catches health provider failures and records a warning diagnostic for the affected package instead of breaking the dashboard. Marketplace integration remains optional; core widgets work from local manifests, installed package data, extension records, runtime gates, and health alerts.
Extensions Page Actions
Section titled “Extensions Page Actions”Use Capell\Admin\Support\Extensions\ExtensionsPageActionRegistry when a package needs to add a command to the Extensions page.
Register header actions for package-level work such as installing example content, syncing metadata, or opening a setup flow. Register table actions only when the action belongs to a specific extension row.
The Extensions page already provides core row actions such as documentation and uninstall where available, so packages should not duplicate those actions.
See Build an extension end to end for the full package authoring flow and code examples.
Extensions Page Contributions
Section titled “Extensions Page Contributions”Optional packages should extend the core Extensions page instead of registering a competing package manager page.
Use ExtensionsPageActionRegistry for header actions that open modal workflows:
resolve(ExtensionsPageActionRegistry::class)->registerHeaderAction( fn (ExtensionsPage $page): Action => Action::make('examplePackageAction') ->label(__('capell-example::actions.example')) ->modalContent(view('capell-example::filament.extensions.example-modal')),);Gate package-management work with ->authorize(fn (): bool => ExtensionsPage::canManageExtensions()).
Use registerTableAction() when the action belongs to one extension row. Table action callbacks receive the row as an array:
resolve(ExtensionsPageActionRegistry::class)->registerTableAction( fn (ExtensionsPage $page): Action => Action::make('checkExtensionHealth') ->label(__('capell-example::actions.check_health')) ->action(fn (array $record): mixed => CheckExtensionHealthAction::run($record['name'])),);Use ExtensionsPageExtender::TAG for status alerts or explanatory blocks shown in the Extensions dashboard actions area. Keep package-specific business logic inside the package contributor. New operational surfaces should prefer an Extensions dashboard Filament widget.
Marketplace connection UI should stay action-oriented:
- When the site is not connected, show the connection state and the Connect Capell account action.
- When the site is connected, do not render a success alert above the table. Show Open Marketplace as the primary header action.
- Open Marketplace opens the marketplace browser in a Filament modal from
/admin/extensions, keeping installed extensions and marketplace browsing in one workflow. - Do not use a large success alert for the connected state. The account link is a means to access Marketplace, not the destination.
- Marketplace catalogue API calls must request JSON and use a sort value the Capell app API supports. The safe default is
recommended; Capell app also accepts the browser sort valuesfeatured_latest,latest,price_low,price_high, andname.
Navigation
Section titled “Navigation”The sidebar has a fixed set of groups, in this order: the Dashboard (ungrouped,
at the top), then Website, Design, Marketing, Business, Reports, Users and
Settings. They are the cases of Capell\Admin\Enums\NavigationGroupEnum.
Packages choose a case; they cannot add a group. If a package needs an area that
none of the cases fits, propose a new case in a pull request to Core.
| Group | What belongs there |
|---|---|
| Website | Pages, articles, media, menus, redirects, sections, events and publishing tools |
| Design | Layouts, themes, block templates and blueprints |
| Marketing | Forms, contacts, newsletters, campaigns, SEO and social tools |
| Business | Bookings, payments, shops, live chat and customer support |
| Reports | Analytics, audits, monitoring and readiness reports |
| Users | Users, roles, access rules and activity logs |
| Settings | Sites, languages, health, security, extensions and system tools |
| Developer | Deployments, demo content, migration and developer reference tools |
Return the case from a resource or page’s getNavigationGroup():
use Capell\Admin\Enums\NavigationGroupEnum;use Override;use UnitEnum;
#[Override]public static function getNavigationGroup(): string|UnitEnum|null{ return NavigationGroupEnum::Business;}Settings metadata lives in Core, which cannot import Admin, so
SettingsGroupMetadata::$navigationGroup takes the case value as a string, for
example navigationGroup: 'marketing'.
Within a group, core items keep a fixed order and package items follow in
alphabetical order of their labels, so $navigationSort does not move a package
item between core items. Groups with no item the person can open are hidden.
Group assignment does not grant access: keep resource policies and page
permissions in place.
Limits
Section titled “Limits”Core Capell keeps to at most 9 groups and 10 top-level items in each group,
and every group holds at least 2 items. The limits live in
capell-admin.navigation and are enforced by tests against the core sidebar.
A site with many packages installed can go over the item limit; every item still
shows in its group.
To keep a group short:
- A package with more than 3 screens registers one sidebar item, a Filament cluster, and shows its other screens as the cluster’s sub-navigation.
- Package settings pages built on
AbstractPackageSettingsPagedo not appear in the sidebar. They appear as cards on the Settings page, under the same group headings. OverridegetHubDescription()andisConfigured()to fill the card. - A package that supersedes a core screen replaces it rather than adding a second item:
CapellAdmin::replaceNavigationItem( replacedKey: \Capell\Admin\Filament\Resources\Redirects\RedirectResource::class, replacementKey: \Capell\Example\Filament\Pages\ExampleRedirectsPage::class,);The replacement takes the replaced item’s place in the group.
Labels
Section titled “Labels”Name a group or item after the thing the person manages, in plain words: Users, not People; Reports, not Insights. Do not use category words such as Content, Growth, Publishing, Operations, Integrations or System as group names. The navigation tests reject these labels.
Moving from the old groups
Section titled “Moving from the old groups”Earlier releases let packages return any translated group label and register
their own groups. The old group keys and labels are no longer recognised: an
item that returns one is shown under Settings and logged. Return a
NavigationGroupEnum case instead. CapellAdmin::registerNavigationGroup() no
longer adds a group.
Permissions
Section titled “Permissions”A package declares the permissions it adds in the permissions list of capell.json. Name each one Verb:Subject in PascalCase, such as View:ExtensionCookbook or Manage:ExtensionCookbook.
{ "permissions": ["View:ExtensionCookbook", "Manage:ExtensionCookbook"]}When the package is installed or enabled, Capell creates each declared permission for the web guard and grants it to the super admin role. No other role receives it: an administrator assigns it to roles from the Roles screen. Running install or enable again changes nothing, and a grant an administrator already made stays.
Wire the permission into a policy so the admin screens honour it. The policy method checks the same string, for example $user->can('View:ExtensionCookbook'). A manifest permission with no policy check grants nothing by itself, and capell:extension-audit reports a contribution that names a permission the manifest does not declare.
Uninstalling a package leaves its permissions and role grants in place, so assignments survive a reinstall and audit history stays readable. Delete the permissions from the Roles screen when you retire them for good.
Debugging Admin Extensions
Section titled “Debugging Admin Extensions”If an admin contribution is missing, start with Extension Troubleshooting. The common fixes are:
- confirm the package admin provider is loaded;
- confirm the bridge was registered and booted for the package name;
- run
php artisan capell:admin-clear-cache; - run
php artisan capell:admin-cache-configuratorsfor configurators and schema extenders; - run
php artisan capell:admin-cache-widgetsfor widgets; - re-run
php artisan capell:admin-installwhen permissions or policies changed.
Command palette
Section titled “Command palette”Extensions register commands at boot with CapellAdmin::registerCommand() and PaletteCommandData. The registry lives for the worker’s lifetime: do not register commands per request or capture the current user in a callback. An optional visible closure receives the current authenticated panel actor and runs inside the page’s site permission scope on every access computation. Without it, the destination must resolve to an accessible registered Filament page or resource; unresolved destinations and actions are hidden. Extensions must also authorise the destination itself.
use Capell\Admin\Data\PaletteCommandData;use Capell\Admin\Facades\CapellAdmin;use Illuminate\Contracts\Auth\Authenticatable;use Illuminate\Support\Facades\Gate;
CapellAdmin::registerCommand(new PaletteCommandData( id: 'acme.reports', label: __('acme::reports.command'), url: '/admin/reports', visible: static fn (Authenticatable $actor): bool => Gate::forUser($actor)->allows('viewReports'),));Visibility callbacks stay on the server, are excluded from transformed/JSON data, and must never be queued or serialised. Register the callback itself at boot; resolve actor-specific decisions when it runs.
Core command IDs are reserved: capell.pages, capell.sites, capell.themes, capell.publishing-studio, capell.settings and capell.extensions. Extension commands using one of these IDs are ignored with a debug log, including when that core destination is inaccessible or absent from the panel.
Navigation shortcuts in capell-admin.shortcuts resolve core targets (with or without the capell. prefix) against accessible core commands only. An extension ID or URL matching a core destination cannot restore its shortcut. Themes resolves through the Theme admin resource group; Publishing Studio resolves through the optional Workspace group. Both must be registered on the current panel and pass canAccess().
Extension navigation shortcuts require an exact registered extension command ID, an explicit visible callback that allows the actor, and a command URL. URL-path matching and automatic ID prefixes are not supported for extension commands. The shortcut receives that command’s resolved URL; commands without a URL cannot enable navigation shortcuts. Hidden extension commands and their shortcut labels/URLs are omitted from render data.
The body-start palette tools view computes commands and shortcuts once and passes the render data to both the keyboard handler and the palette. Search filters the rendered list locally after a 250 ms debounce, without server requests or additional permission queries. Livewire actions recompute access using the original page’s recorded site context. Access results are never stored across renders or in Livewire’s public state; the request-scoped route context stores no grants and survives permission cache resets. Keyboard listeners are removed when the component is destroyed or Livewire navigation begins.