la-souris / filament-env-indicator
Filament v5 plugin to change the header color according to environment
Package info
github.com/la-souris/package-filament-env-indicator
pkg:composer/la-souris/filament-env-indicator
v1.0
2026-07-22 12:12 UTC
Requires
- php: ^8.5
- filament/filament: ^5.6
- filament/support: ^5.6
Requires (Dev)
- laravel/pint: ^1.18
- orchestra/testbench: ^10.0
- phpunit/phpunit: ^11.0
README
la-souris/filament-env-indicator is a Filament v5 plugin that makes non-production panels visually obvious by:
- recoloring the Filament topbar,
- recoloring the global search field to match,
- and adding a small environment badge before global search.
This helps avoid mistakes when switching between local, staging-like, and demo/admin environments.
Example
Requirements
- PHP
^8.5 - Filament
^5.6
Installation
composer require la-souris/filament-env-indicator
Basic usage
Register the plugin on your panel provider:
use Filament\Panel; use LaSouris\FilamentEnvIndicator\EnvironmentIndicatorPlugin; public function panel(Panel $panel): Panel { return $panel ->plugin(EnvironmentIndicatorPlugin::make()); }
Default behavior
- Nothing is shown in
production(styles and badge are disabled). - Defaults are provided for:
localanddevelopment(green),demo(amber),acceptance(red).
- Environments not registered on the plugin are ignored.
- The badge text is the current Laravel environment name (
app()->environment()). - The current git branch is included as the badge tooltip (
title) when available.
Customizing environments
Use environment() to add new environment themes or override defaults:
use Filament\Support\Colors\Color; use LaSouris\FilamentEnvIndicator\EnvironmentIndicatorPlugin; EnvironmentIndicatorPlugin::make() ->environment('staging', Color::Yellow, topbarShade: '600', topbarAccent: '100', textColor: 'black') ->environment('local', Color::Blue, topbarShade: '700', topbarAccent: '100', textColor: 'white');
Method signature:
environment( string $name, array $palette, string $topbarShade = '500', string $topbarAccent = '50', string $textColor = 'black', )
$paletteshould be a Filament color palette (for exampleColor::Blue).- Shade values like
'50','500','800'must exist on the palette.
Testing
composer test
Credits
This package is inspired by pxlrbt/filament-environment-indicator.


