PHPackages                             learnkit/filament-environment - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. learnkit/filament-environment

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

learnkit/filament-environment
=============================

Environment plugin for Filament

1.4.1(1mo ago)054proprietaryPHPPHP ^8.2

Since Jul 22Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/learnkit-dev/filament-environments)[ Packagist](https://packagist.org/packages/learnkit/filament-environment)[ RSS](/packages/learnkit-filament-environment/feed)WikiDiscussions main Synced today

READMEChangelog (5)Dependencies (4)Versions (8)Used By (0)

Filament Environment
====================

[](#filament-environment)

A small Laravel package that adds a vertical colored bar to the left edge of every [Filament](https://filamentphp.com) panel page, showing the current `App::environment()` value. Useful for instantly knowing whether you are looking at `local`, `staging`, or `production` when juggling multiple tabs.

Supports Filament **v3, v4 and v5**.

Installation
------------

[](#installation)

```
composer require learnkit/filament-environment
```

The service provider is auto-discovered via `extra.laravel.providers`, so no further wiring is required.

Configuration
-------------

[](#configuration)

Publish the config file if you want to customise the colors:

```
php artisan vendor:publish --tag=config --provider="LearnKit\FilamentEnvironment\FilamentEnvironmentServiceProvider"
```

Or simply create `config/filament-environment.php` with the keys you want to override — the package uses `mergeConfigFrom`, so partial overrides work.

```
return [
    'mapping' => [
        'local'      => '#FFDB58',
        'dev'        => '#FFDB58',
        'staging'    => '#D2042D',
        'prod'       => '#4169E1',
        'production' => '#4169E1',
    ],

    'production' => [
        'prod', 'production',
    ],
];
```

- **`mapping`** — maps the value returned by `App::environment()` to a hex color. If the current environment is not in the map, the first entry is used as fallback.
- **`production`** — a list of environment names you consider "production". The package itself does not act on this; it is exposed so consumers can read it via `config('filament-environment.production')`.

Conditionally hiding the bar
----------------------------

[](#conditionally-hiding-the-bar)

Use the static `gate()` method (e.g. from `AppServiceProvider::boot()`) to control when the bar should render. The gate runs on every request inside `Filament::serving()`, so you can rely on runtime state like the authenticated user:

```
use LearnKit\FilamentEnvironment\FilamentEnvironment;

FilamentEnvironment::gate(fn () => auth()->user()?->isAdmin() ?? false);
```

When no gate is set, the bar is always shown.

How it works
------------

[](#how-it-works)

On `Filament::serving()` the service provider registers a `PanelsRenderHook::BODY_START` hook that renders `resources/views/bar.blade.php`. Because `BODY_START` is panel-agnostic, the bar appears in every Filament panel without per-panel plugin registration. The view also injects a small amount of inline CSS to give `.fi-layout` a `padding-left` so the panel content does not sit underneath the bar.

License
-------

[](#license)

Proprietary — © LearnKit.

###  Health Score

44

—

FairBetter than 90% of packages

Maintenance91

Actively maintained with recent releases

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~111 days

Recently: every ~119 days

Total

7

Last Release

42d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/6506510?v=4)[Sebastiaan Kloos](/maintainers/SebastiaanKloos)[@SebastiaanKloos](https://github.com/SebastiaanKloos)

---

Top Contributors

[![SebastiaanKloos](https://avatars.githubusercontent.com/u/6506510?v=4)](https://github.com/SebastiaanKloos "SebastiaanKloos (9 commits)")

### Embed Badge

![Health badge](/badges/learnkit-filament-environment/health.svg)

```
[![Health](https://phpackages.com/badges/learnkit-filament-environment/health.svg)](https://phpackages.com/packages/learnkit-filament-environment)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[bezhansalleh/filament-google-analytics

Google Analytics integration for FilamentPHP

211189.7k8](/packages/bezhansalleh-filament-google-analytics)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
