Filament Environment Indicator

Adds a colored banner and badge to a Filament admin panel showing which environment you're viewing.

Library
Composer
vv3.6.0
152stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
64/100Good
Development Activity64
Maintenance48
Community68
Maturity56
Momentum20

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
62/100Good
Architecture55
Code Quality58
Innovation45
Learning Curve90

Filament Environment Indicator is a small plugin for the Filament admin panel builder that adds a visible colored border and badge to the interface, so developers and admins can immediately tell whether they’re looking at production, staging, or a local environment. It solves a common and costly mistake in teams running multiple Filament-powered admin panels across environments: accidentally performing a destructive action in production because a browser tab looked identical to staging.

Registered as a Filament panel plugin with a single EnvironmentIndicatorPlugin::make() call, it reads the application’s environment and renders a customizable, publishable Blade view; visibility can be restricted (by default it checks for Spatie Permission’s super_admin role) so the indicator doesn’t leak environment details to non-privileged users.

What You Get

  • A colored top-border and badge that visually distinguishes production, staging, and local Filament panel instances
  • A fluent EnvironmentIndicatorPlugin API for customizing colors, labels, and visibility conditions
  • Built-in integration with Spatie’s Permission package to restrict visibility to super-admin users by default
  • A publishable Blade view (vendor:publish --tag=filament-environment-indicator-views) for full visual customization
  • Support for both Filament 4.x and 5.x panels

Common Use Cases

  • Preventing accidental production data changes by making it visually obvious which environment an open admin-panel tab belongs to
  • Giving support or QA staff working across multiple environments an at-a-glance environment cue without checking the URL bar
  • Restricting environment visibility to super-admins only, so junior staff or client users never see internal environment details
  • Customizing the indicator’s colors and labels per project (e.g. red for production, yellow for staging) to match team conventions

Under The Hood

Architecture — FilamentEnvironmentIndicatorServiceProvider (24 lines) is a minimal Laravel service provider that registers the package’s views and publishable assets; EnvironmentIndicatorPlugin.php (242 lines) implements Filament’s Plugin contract, exposing a fluent configuration surface (color/label/visibility callbacks) that Filament’s panel bootstrap process invokes during render to inject the border and badge Blade partial into the panel layout. Tech Stack — PHP 8.0+/8.1+ depending on plugin major version, targets filament/filament ^4.0|^5.0 as its sole runtime dependency, with a small Blade view and CSS asset for the visual indicator; laravel/pint enforces code style, checked via a GitHub Actions code-style workflow. Code Quality — The codebase is deliberately minimal (under 300 lines total) with a single-responsibility plugin class and no test suite of its own, relying instead on Filament’s own plugin contract for correctness and on the small surface area to keep bugs unlikely; style is enforced automatically in CI via Pint. API Design — Installation is a single EnvironmentIndicatorPlugin::make() call registered in a panel’s plugin list, following Filament’s own plugin conventions exactly, so any developer already familiar with registering Filament plugins needs zero extra learning to adopt it, and further customization (visibility, colors) is exposed as additional fluent method calls on the same object rather than a separate config file.

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search