Overview

The admin bar is a first-party panel plugin (filament-admin-bar) that renders a WordPress-style frontend toolbar for logged-in users with the right Shield role. It is part of the Docs stack plugin set and ships look-neutral by intent — the default skin is a placeholder, not the product design.

What it is

A Filament panel plugin built on filamentphp/plugin-skeleton. The service provider (FilamentAdminBarServiceProvider) extends Spatie's PackageServiceProvider, publishes the admin-bar config, the create_admin_bar_settings_table migration, and the filament-admin-bar view namespace. The Plugin object (FilamentAdminBarPlugin, id admin-bar) registers the settings page and wires the default panel id.

Components

  • FilamentAdminBarPlugin — the Filament\Contracts\Plugin class. register() adds the AdminBarSettings page, pins the default panel id, and forwards newItems() / editUsing() resolvers onto AdminBar.
  • AdminBar — the renderer facade. Static state holds the panel id, the New items list, and the Edit resolver. visible() returns false on panel requests, for guests, and when no role is enabled; otherwise it checks hasRole() against the enabled roles.
  • AdminBarSetting — Eloquent model on admin_bar_settings. Single row; roles is a JSON array of Spatie/Shield role names.
  • AdminBarSettings page — panel page under Settings, gated to super_admin. Embeds the ManageRoles Livewire component so each role gets a checkbox.
  • bar.blade.php — the toolbar view. Inlined CSS, scoped to .filament-admin-bar. Renders the dashboard link, the New dropdown, the Edit link, and the "Howdy, {user}" logout menu.

Default look

The shipped bar.blade.php paints a 32px fixed bar in #1d2327 with #f0f0f1 text — the classic WP-dark palette. Per ADR 0006 and ADR 0008, that skin is meant to be overridden in the product clone; the plugin is look-neutral and never loops its visual language back into the template.

Settings

Visibility is a checkbox per role, stored in admin_bar_settings. When no row exists, AdminBar::enabledRoles() falls back to config('admin-bar.default_roles'). The bar renders on public pages only — onPanelRequest() hides it inside any Filament panel path. New/Edit actions are not defined by the plugin; the clone wires them via newItems() and editUsing().

flowchart LR
    U[Logged-in user] --> R{Role check vs admin_bar_settings}
    R -- hasRole --> B[AdminBar renders bar.blade.php]
    R -- no role / guest --> X[No bar]
    B --> F[Public frontend]
    S[Settings page: super_admin] -->|ManageRoles| DB[(admin_bar_settings)]
    DB --> R

See also

Built by Qcentic