PHPackages                             gillobis/laravel-envbar - 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. gillobis/laravel-envbar

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

gillobis/laravel-envbar
=======================

Visual environment indicator bar for Laravel

0.3.0(1mo ago)14MITPHPPHP ^8.2CI passing

Since Apr 14Pushed 1mo agoCompare

[ Source](https://github.com/gillobis/laravel-envbar)[ Packagist](https://packagist.org/packages/gillobis/laravel-envbar)[ RSS](/packages/gillobis-laravel-envbar/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (1)Dependencies (6)Versions (6)Used By (0)

Laravel Envbar
==============

[](#laravel-envbar)

[![Latest Version on Packagist](https://camo.githubusercontent.com/b324d6d5b3c78acca0917d4367ee3152211fae74a2300adfa6489ec0dd674172/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f67696c6c6f6269732f6c61726176656c2d656e766261722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/gillobis/laravel-envbar)[![Total Downloads](https://camo.githubusercontent.com/fde72092b16cacafb29072571c31abebcec435f564bd5d84fdb3628b54172b7f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f67696c6c6f6269732f6c61726176656c2d656e766261722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/gillobis/laravel-envbar)[![Tests](https://camo.githubusercontent.com/eba5088a7fa286eef11e4232511fd86c3a90ade41c2044757b9d08cd7f47c41f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f67696c6c6f6269732f6c61726176656c2d656e766261722f74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/gillobis/laravel-envbar/actions/workflows/tests.yml)[![PHP Version](https://camo.githubusercontent.com/b5da4cd819dc2313c1df1372b33bb4a9efb51631e0ac44a8a1fc38004aab1b9f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f67696c6c6f6269732f6c61726176656c2d656e766261722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/gillobis/laravel-envbar)[![Laravel](https://camo.githubusercontent.com/b21bc2003aa619c22eebfa5bcd69dca1cc7effe70502ebde76cd4801f3c84f9e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d3130253230253743253230313125323025374325323031322d4646324432303f7374796c653d666c61742d737175617265266c6f676f3d6c61726176656c266c6f676f436f6c6f723d7768697465)](https://laravel.com)[![License](https://camo.githubusercontent.com/846a4b9880661cea797bb0ab10bc683973d7c6a7323733135b4d2b3f25739d0d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f67696c6c6f6269732f6c61726176656c2d656e766261722e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)

A visual environment indicator bar for Laravel applications. Instantly see which environment you're working on — local, staging, testing, or production — with a fully configurable, zero-dependency toolbar injected into your HTML pages.

[![Preview](image.png)](image.png)

Features
--------

[](#features)

- **Zero dependencies** — Inline CSS and JS, no external frameworks required
- **Auto-injection** — Automatically injected into HTML responses via middleware
- **Per-environment colors &amp; icons** — Customize background, text color, and icon per environment
- **Configurable segments** — Show/hide app name, PHP version, Laravel version, git branch, commit SHA, hostname, database, authenticated user, server timestamp
- **Collapsible** — Users can minimize the bar to a small pill; state persisted in `localStorage`
- **Environment switcher** — Quick links to the same URL on other environments
- **Favicon overlay** — Adds a colored badge to the browser favicon via canvas
- **Top or bottom positioning** — Fixed bar with automatic body offset
- **Gate authorization** — Restrict visibility using a Laravel Gate
- **Publishable config &amp; views** — Full control over behavior and appearance
- **Inter font** — Uses the Inter variable font for a clean, modern look

Requirements
------------

[](#requirements)

- PHP 8.2+
- Laravel 11, 12, or 13

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

[](#installation)

```
composer require gillobis/laravel-envbar
```

The package auto-registers its service provider via Laravel's package discovery.

### Publish the configuration

[](#publish-the-configuration)

```
php artisan vendor:publish --tag=envbar-config
```

This creates `config/envbar.php` where you can customize all options.

### Publish the views (optional)

[](#publish-the-views-optional)

```
php artisan vendor:publish --tag=envbar-views
```

### Set the environment variable to enable the bar

[](#set-the-environment-variable-to-enable-the-bar)

In your `.env` file, enable the bar for your desired environments:

```
ENVBAR_ENABLED=true
```

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

[](#configuration)

### Basic options

[](#basic-options)

```
// config/envbar.php
return [
    'enabled'      => env('ENVBAR_ENABLED', false),
    'environments' => ['local', 'development', 'staging', 'testing'],
    'position'     => env('ENVBAR_POSITION', 'top'), // 'top' | 'bottom'
    'theme'        => env('ENVBAR_THEME', 'auto'),   // 'light' | 'dark' | 'auto'
    'collapsible'  => true,
    'gate'         => null, // e.g. 'viewEnvbar'
];
```

### Per-environment appearance

[](#per-environment-appearance)

```
'environments_config' => [
    'local' => [
        'label'            => 'LOCAL',
        'background_color' => '#6c757d',
        'text_color'       => '#ddd',
        'icon'             => '💻',
    ],
    'staging' => [
        'label'            => 'STAGING',
        'background_color' => '#fdc700',
        'text_color'       => '#111',
        'icon'             => '🎪',
    ],
    // ...
],
```

### Info segments

[](#info-segments)

Toggle which information to display in the bar:

```
'show' => [
    'app_name'        => true,
    'php_version'     => true,
    'laravel_version' => true,
    'git_branch'      => true,
    'git_commit'      => false,
    'hostname'        => false,
    'database'        => false,
    'user'            => false,
    'timestamp'       => false,
],
```

### Environment switcher

[](#environment-switcher)

Add quick-switch links to the same page on other environments:

```
'switcher' => [
    'enabled' => true,
    'environments' => [
        'local'   => 'http://myapp.test',
        'staging' => 'https://staging.myapp.com',
    ],
],
```

### Favicon overlay

[](#favicon-overlay)

Add a colored badge on the browser favicon:

```
'favicon_overlay' => env('ENVBAR_FAVICON', false),
```

Environment Variables
---------------------

[](#environment-variables)

VariableDefaultDescription`ENVBAR_ENABLED``false`Enable/disable the bar globally`ENVBAR_POSITION``top`Bar position: `top` or `bottom``ENVBAR_THEME``auto`Theme: `light`, `dark`, or `auto``ENVBAR_FAVICON``false`Enable favicon overlayHow It Works
------------

[](#how-it-works)

1. `EnvbarServiceProvider` registers the `InjectEnvbar` middleware in the `web` group
2. The middleware checks if the response is HTML and if the bar is enabled for the current environment
3. The bar HTML (with inline CSS/JS) is injected before the `` tag
4. No external assets are loaded (except the Inter font from Google Fonts)

Authorization
-------------

[](#authorization)

To restrict visibility, define a Gate and reference it in the config:

```
// AppServiceProvider
Gate::define('viewEnvbar', function (User $user) {
    return $user->isAdmin();
});

// config/envbar.php
'gate' => 'viewEnvbar',
```

Testing
-------

[](#testing)

```
composer test
```

License
-------

[](#license)

MIT

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance90

Actively maintained with recent releases

Popularity5

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity40

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 ~2 days

Total

5

Last Release

46d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/53f7b28986c8b42ad26f3e939fd348800b4b50e793fa4d967aa97ee90ec2a058?d=identicon)[gillobis](/maintainers/gillobis)

---

Top Contributors

[![gillobis](https://avatars.githubusercontent.com/u/9199228?v=4)](https://github.com/gillobis "gillobis (14 commits)")

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/gillobis-laravel-envbar/health.svg)

```
[![Health](https://phpackages.com/badges/gillobis-laravel-envbar/health.svg)](https://phpackages.com/packages/gillobis-laravel-envbar)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3325.1M337](/packages/psalm-plugin-laravel)[renatomarinho/laravel-page-speed

Laravel Page Speed

2.5k1.7M11](/packages/renatomarinho-laravel-page-speed)[illuminate/pipeline

The Illuminate Pipeline package.

9348.3M264](/packages/illuminate-pipeline)[illuminate/pagination

The Illuminate Pagination package.

10533.5M984](/packages/illuminate-pagination)[illuminate/redis

The Illuminate Redis package.

8314.4M356](/packages/illuminate-redis)[spatie/laravel-export

Create a static site bundle from a Laravel app

670139.5k6](/packages/spatie-laravel-export)

PHPackages © 2026

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