la-souris/filament-env-indicator

Filament v5 plugin to change the header color according to environment

Maintainers

Package info

github.com/la-souris/package-filament-env-indicator

pkg:composer/la-souris/filament-env-indicator

Transparency log

Statistics

Installs: 2

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 1

v1.0 2026-07-22 12:12 UTC

This package is auto-updated.

Last update: 2026-07-22 13:45:07 UTC


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

local.png acceptance.png production.png

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:
    • local and development (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',
)
  • $palette should be a Filament color palette (for example Color::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.