Skip to content

arnautdev/filament-deploy-indicator

Repository files navigation

Filament Deploy Indicator

Show the current application environment (ENV) and optional latest deployment info in your Filament topbar.

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

Features

  • Shows current APP_ENV (mapped to a short label like PROD, STAGE, LOCAL) in the Filament topbar.
  • Optional small hint next to the label: commit hash or deploy time.
  • Reads deployment metadata from a JSON file (default: storage/app/private/deploy-info.json).
  • Can auto-generate the JSON when missing (using git), if enabled.

Requirements

  • PHP ^8.2
  • Filament ^4.0 or ^5.0

Installation

Install the package via Composer:

composer require arnautdev/filament-deploy-indicator

Register the plugin

Add the plugin to your panel:

use Arnautdev\FilamentDeployIndicator\FilamentDeployIndicatorPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        ->plugins([
            FilamentDeployIndicatorPlugin::make(),
        ]);
}

Conditional visibility

You can control who can see the deploy indicator by using the ->visible() method when registering the plugin.

Show only for admins

use Arnautdev\FilamentDeployIndicator\FilamentDeployIndicatorPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        ->plugins([
            FilamentDeployIndicatorPlugin::make()
                ->visible(fn (): bool => auth()->user()?->is_admin === true),
        ]);
}

Configuration

Publish the config file:

php artisan vendor:publish --tag="filament-deploy-indicator-config"

Config file: config/filament-deploy-indicator.php

Main options

Option Description
position Filament render hook position
cache_ttl Cache time in seconds
file_path Path to deployment JSON
auto_generate_when_missing Generate JSON using git if missing
write_path Where generated JSON should be written
git_root Root of the git repository
env_map Mapping of env → label + color
topbar.show null, commit, or deployed_at

Generate deployment info manually

The package provides an Artisan command to generate the deployment metadata JSON file.

php artisan filament-deploy-indicator:write

Deployment JSON format

The plugin reads a JSON file like:

{
  "environment": "local",
  "deployed_at": "2026-03-04 16:30:00",
  "commit": "33de817",
  "branch": "feature/deploy-indicator",
  "author": "You",
  "commit_message": "Local test"
}

Default location:

storage/app/private/deploy-info.json

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.