lukasccb/filament-balance-header
A Filament plugin that adds a balance header component to your admin panel, letting you display an account balance or credit total at a glance. Quick to install and configure for Filament v3 panels.
Confirm your stack. This is a Filament panel plugin — it does nothing outside a Filament admin panel. Check the repo's composer.json for the supported filament/filament constraint (last release Jan 2024 points at Filament v3; verify before trying it on v4). If you are not on Filament, stop here.
Install and pin.
composer require lukasccb/filament-balance-header:1.0.3
Pin the exact version. The changelog is a bare compare link, so there is no signal to trust floating constraints on a single-maintainer v1.x package.
Register it as a panel plugin (preferred) in your PanelProvider:
public function panel(Panel $panel): Panel
{
return $panel
->plugin(BalanceHeaderPlugin::make());
// ...
}
The alternative is registering it through a render hook if you only want it on specific pages — see the next section. Confirm the exact plugin class name and fluent method names in src/, because the README is sparse and the package exposes a very small surface.
Read these first, in order: src/ for the plugin + render-hook class, the Blade view for the header (that is where label/icon/formatting live), then the release tags to see how little has changed across 1.0.x. There is no meaningful docs site — the source is the documentation.
First use case to prove out: a read-only display of the current user's (or tenant's) credit balance in the topbar, backed by a value you already compute elsewhere. Do not start by wiring it to fresh billing logic; wire it to an existing service method so you can validate the display path in isolation.
Plugin registration vs. render hook. Two integration styles, and they are not equivalent:
Feed it from a service, not from the component. Keep the balance calculation in your own application (an action, a BalanceService, a cached lookup) and pass the result into the header. This keeps the display component dumb, makes it testable, and makes replacing the package trivial later.
Resolve per-user / per-tenant, lazily. The header renders on every panel page, so the value fetch runs constantly. Prefer a scoped query or a short-TTL cache keyed by user/tenant over recomputing an aggregate on each request.
Compose, don't collide, with existing header widgets. The package is designed to sit alongside Filament header widgets and actions. If you already render wallet info in a widget, decide which one is canonical — showing the same number twice in the topbar looks like a bug.
Configuration as presentation, not logic. Treat label, icon, and styling options as theme surface. Keep currency formatting and rounding decisions in your formatter (e.g. Number::currency(...) with an explicit locale) so the number shown in the header matches the number shown on the billing page to the cent.
Conditional exposure. Gate registration behind a feature flag or role check in the PanelProvider (or a policy) so the header can be enabled for ops/support only during a pilot, and disabled without a deploy.
0 on error is worse than hiding the component.How can I help you explore Laravel packages today?