TabletopDOCS
API Reference

Panel

Panel-level configuration: routing, appearance, navigation, chrome and the command palette.

Panel-level configuration: routing, appearance, navigation, chrome and the command palette.

PanelConfig

Tbtop\Admin\Panels\PanelConfig

MethodWhat it does
authStack(): arrayThe panel's auth/app middleware layer a page spreads to add to it, e.g. middleware(PanelConfig $p): array { return [...$p->authStack(), 'can:x']; }. Excludes SetCurrentPanel/SetAdminLocale — the route layer always applies those.
brand(string $brand): staticBrand name shown in the chrome (sidebar/topbar header).
breadcrumbs(bool $enabled = true): staticWhether pages build and send the breadcrumbs prop.
chrome(string $chrome): staticClass-string of a Chrome subclass that authors the shell (header/sidebar/ footer). Override headerItems()/sidebarItems() and spread the parent to append to the stock shell; override header()/sidebar()/footer() to replace an area outright.
commandPalette(Closure|bool $config = true): staticEnable (default), disable with false, or configure the ⌘K command palette via a closure. The closure receives the CommandPaletteConfig to mutate (->commands([Command::make(...)...])) and returns nothing.
darkMode(bool $enabled = true): staticAllow or disable the dark-mode toggle entirely (default: allowed).
defaultLocale(string $locale): staticDefault admin UI locale, overriding the first entry of locales().
defaultThemeMode(string $mode): staticInitial theme when the visitor has no saved preference.
density(string $mode): staticShell density: 'compact' tightens control heights, spacing, and the sidebar width.
discoverPages(string $in, string $for): staticAdds a recursive page discovery directory and its Composer-autoloadable namespace; rebuild the page cache after adding pages.
guard(string $guard): staticAuth guard checked by authStack(). Defaults to 'web'.
id(string $id): staticFeeds the route-name namespace (tbtop.{id}.*) — changing it on an existing panel renames every route.
locales(array $locales): staticAdmin UI locales. First entry is the default unless defaultLocale() is set.
maxContentWidth(string $width): staticCenter page content to a Tailwind max-w token (e.g. '7xl').
middleware(array $middleware): staticReplaces the default ['web'] app-middleware stack rather than appending to it; authStack() adds auth:{guard} on top at read time.
navigation(string $navigation): staticShell navigation layout: 'sidebar' (default), 'topbar', or 'topbar-sidebar' (full-width bar with a sidebar beneath it). The client renders the same chrome blocks; only their arrangement changes. All layouts collapse to a burger drawer on mobile.
navigationGroups(array $groups): staticPer-group nav metadata as a list of NavGroup::make('Content')->icon('file-text') ->collapsible(), matched to a page's nav()['group'] by that label.
navigationItems(array $items): staticExtra always-shown nav entries with no page/gate (e.g. an external link), merged into the built tree alongside page-derived items, grouped by label the same way navigationGroups() matches groups.
notificationsPolling(?int $seconds): staticSeconds between header-bell polls for new notifications. null disables auto-polling (the bell still fetches when opened). Mirrors Filament's databaseNotificationsPolling(); only active when the chrome renders a notifications bell.
pages(array $pages): staticReplaces manual pages; discovery merges them first and removes duplicate classes.
prefix(string $prefix): staticURL path prefix the panel is mounted under. Defaults to the panel id when unset — see getPrefix().
rootView(string $view): staticBlade root view rendered on first visit (per-panel Vite entry escape hatch).
unsavedGuard(bool $enabled = true): staticDefault for the unsaved-changes navigation guard on forms.
userMenuItems(array $items): staticCustom profile-dropdown entries rendered alongside the fixed theme/locale/logout controls. Link-only (label/icon/href/newTab) — chrome trees are page-independent (no per-request endpoint for a server closure to resolve against), same constraint as NotificationAction.

Chrome

Tbtop\Admin\Panels\Chrome

MethodWhat it does
footer(S $s): ?NodeNo footer in the stock shell.
header(S $s): ?NodeTopbar content. The shell right-aligns it; align: center keeps items of differing heights on one axis instead of stretching to the tallest.
sidebar(S $s): ?NodeSidebar content: logo on top, nav groups below.

Tbtop\Admin\Navigation\NavGroup

MethodWhat it does
collapsed(bool $collapsed = true): selfStart the group collapsed (implies collapsible).
collapsible(bool $collapsible = true): selfRender the group header as a collapse toggle.
icon(string $name, string $position = 'left'): static$name is a kebab-case Lucide icon name (e.g. 'circle-check') resolved against the client's icon registry; register custom names client-side via registerIcon before using them here. $position is 'left' (default) or 'right', placing the icon relative to the label.
label(Closure|string $label): selfTranslated header text shown in the sidebar. Pass a Closure to defer translation to request time — panel config is built once (singleton), so a bare __() there would freeze on the first request's locale.

Tbtop\Admin\Navigation\NavItem

MethodWhat it does
group(string $group): selfSidebar group heading this item is listed under (nav context only); unset = ungrouped, no heading.
icon(string $name, string $position = 'left'): static$name is a kebab-case Lucide icon name (e.g. 'circle-check') resolved against the client's icon registry; register custom names client-side via registerIcon before using them here. $position is 'left' (default) or 'right', placing the icon relative to the label.
newTab(bool $newTab = true): selfOpen url() in a new browser tab instead of navigating in place.
sort(int $order): selfSort position within its group (nav context only).
url(string $url): selfDestination URL — an internal path or an external link.

CommandPaletteConfig

Tbtop\Admin\CommandPalette\CommandPaletteConfig

MethodWhat it does
commands(array $commands): staticReplaces the custom command list; additive to includeNav()'s auto-listed sidebar destinations, not a substitute for it.
disable(): staticSugar for enable(false); a disabled palette is omitted from the wire entirely.
enable(bool $enabled = true): staticPalette is enabled by default; pass false to disable it (same as disable()).
hotkey(string $spec): staticKeybinding that opens the palette (default ⌘K / Ctrl+K).
includeNav(bool $include = true): staticAuto-list sidebar destinations (default true). false = commands only.
placeholder(string $text): staticPlaceholder text for the palette search input.

Command

Tbtop\Admin\CommandPalette\Command

MethodWhat it does
group(string $group): selfGroup heading the command is listed under.
handler(string $name): selfRun a client handler registered via definePaletteCommand() instead of navigating.
icon(string $name, string $position = 'left'): static$name is a kebab-case Lucide icon name (e.g. 'circle-check') resolved against the client's icon registry; register custom names client-side via registerIcon before using them here. $position is 'left' (default) or 'right', placing the icon relative to the label.
keywords(array $keywords): selfExtra search terms beyond the label.
openInNewTab(bool $newTab = true): selfOpen url() in a new browser tab instead of navigating in place. No effect when handler() is used instead of url().
url(string $url): selfNavigate to a URL — an internal path (Inertia visit) or an external link.

On this page