{"id":13733263,"url":"https://github.com/pxlrbt/filament-environment-indicator","last_synced_at":"2025-05-15T20:04:58.048Z","repository":{"id":45661945,"uuid":"513938278","full_name":"pxlrbt/filament-environment-indicator","owner":"pxlrbt","description":"Never confuse your tabs with different Filament environments again.","archived":false,"fork":false,"pushed_at":"2025-01-04T05:03:45.000Z","size":738,"stargazers_count":127,"open_issues_count":0,"forks_count":13,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-04-08T04:11:44.560Z","etag":null,"topics":["environment","filamentadmin","filamentphp"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pxlrbt.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"pxlrbt"}},"created_at":"2022-07-14T14:43:17.000Z","updated_at":"2025-04-05T08:32:32.000Z","dependencies_parsed_at":"2022-08-12T12:00:21.326Z","dependency_job_id":"56620234-20e8-460e-aec7-ea216ce1fd0c","html_url":"https://github.com/pxlrbt/filament-environment-indicator","commit_stats":{"total_commits":31,"total_committers":8,"mean_commits":3.875,"dds":"0.29032258064516125","last_synced_commit":"928ccebe9ce14810805b8c23f994f1392e321da2"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pxlrbt%2Ffilament-environment-indicator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pxlrbt%2Ffilament-environment-indicator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pxlrbt%2Ffilament-environment-indicator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pxlrbt%2Ffilament-environment-indicator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pxlrbt","download_url":"https://codeload.github.com/pxlrbt/filament-environment-indicator/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254414499,"owners_count":22067272,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["environment","filamentadmin","filamentphp"],"created_at":"2024-08-03T03:00:40.240Z","updated_at":"2025-05-15T20:04:49.997Z","avatar_url":"https://github.com/pxlrbt.png","language":"PHP","funding_links":["https://github.com/sponsors/pxlrbt"],"categories":["UI","Plugins"],"sub_categories":["Administration \u0026 Management"],"readme":"![header](./.github/resources/pxlrbt-environment-indicator.png)\n\n\n# Filament Environment Indicator\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/pxlrbt/filament-environment-indicator.svg?include_prereleases)](https://packagist.org/packages/pxlrbt/filament-environment-indicator)\n[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg)](LICENSE.md)\n![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/pxlrbt/filament-environment-indicator/code-style.yml?branch=main\u0026label=Code%20style\u0026style=flat-square)\n[![Total Downloads](https://img.shields.io/packagist/dt/pxlrbt/filament-environment-indicator.svg)](https://packagist.org/packages/pxlrbt/filament-environment-indicator)\n\nNever confuse your tabs with different Filament environments again.\n\n![Screenshot](./.github/resources/preview.gif)\n\n## Installation via Composer\n\n| Plugin Version | Filament Version | PHP Version |\n|----------------|-----------------|-------------|\n| 1.x            | ^2.9.15   | \\\u003e 8.0      |\n| 2.x            | 3.x             | \\\u003e 8.1      |\n\n```bash\ncomposer require pxlrbt/filament-environment-indicator\n```\n\n## Usage\n\nTo use this plugin register it in your panel configuration:\n\n```php\nuse pxlrbt\\FilamentEnvironmentIndicator\\EnvironmentIndicatorPlugin;\n\n$panel\n    -\u003eplugins([\n        EnvironmentIndicatorPlugin::make(),\n    ]);\n```\n\n## Configuration\n\nOut of the box, this plugin adds a colored border to the top of the admin panel and a badge next to the search bar.\n\nYou can customize any behaviour via the plugin object.\n\n### Customizing the view\nUse `php artisan vendor:publish --tag=\"filament-environment-indicator-views\"` to publish the view to the `resources/views/vendor/filament-environment-indicator` folder. After this you can customize it as you wish!\n\n### Visibility\n\nBy default, the package checks whether you have Spatie permissions plugin installed and checks for a role called `super_admin`. You can further customize whether the indicators should be shown.\n\n```php\nuse pxlrbt\\FilamentEnvironmentIndicator\\EnvironmentIndicatorPlugin;\n\n$panel-\u003eplugins([\n    EnvironmentIndicatorPlugin::make()\n        -\u003evisible(fn () =\u003e auth()-\u003euser()?-\u003ecan('see_indicator'))\n]);\n```\n\n### Colors\n\nYou can overwrite the default colors if you want your own colors or need to add more. The `-\u003ecolor()`method accepts any Filament's Color object or a closure that returns a color object.\n\n```php\nuse pxlrbt\\FilamentEnvironmentIndicator\\EnvironmentIndicatorPlugin;\nuse Filament\\Support\\Colors\\Color;\n\n$panel-\u003eplugins([\n    EnvironmentIndicatorPlugin::make()\n        -\u003ecolor(fn () =\u003e match (app()-\u003eenvironment()) {\n            'production' =\u003e null,\n            'staging' =\u003e Color::Orange,\n            default =\u003e Color::Blue,\n        })\n]);\n```\n\n### Indicators\n\nBy default, both indicators are displayed on non-production environments. You can turn them off separately.\n\n```php\nuse pxlrbt\\FilamentEnvironmentIndicator\\EnvironmentIndicatorPlugin;\nuse Filament\\Support\\Colors\\Color;\n\n$panel-\u003eplugins([\n    EnvironmentIndicatorPlugin::make()\n        -\u003eshowBadge(false)\n        -\u003eshowBorder(true)            \n]);\n```\n\n### Git Branch\n\nYou can enable the display of the current git branch in the badge via `-\u003eshowGitBranch()`. This requires the `exec()` function to be enabled in your PHP configuration.\n\n```php\nuse pxlrbt\\FilamentEnvironmentIndicator\\EnvironmentIndicatorPlugin;\nuse Filament\\Support\\Colors\\Color;\n\n$panel-\u003eplugins([\n    EnvironmentIndicatorPlugin::make()\n        -\u003eshowGitBranch()                    \n]);\n```\n\n## Contributing\n\nIf you want to contribute to this packages, you may want to test it in a real Filament project:\n\n- Fork this repository to your GitHub account.\n- Create a Filament app locally.\n- Clone your fork in your Filament app's root directory.\n- In the `/filament-environment-indicator` directory, create a branch for your fix, e.g. `fix/error-message`.\n\nInstall the packages in your app's `composer.json`:\n\n```json\n\"require\": {\n    \"pxlrbt/filament-environment-indicator\": \"dev-fix/error-message as main-dev\",\n},\n\"repositories\": [\n    {\n        \"type\": \"path\",\n        \"url\": \"filament-environment-indicator\"\n    }\n]\n```\n\nNow, run `composer update`.\n\n## Credits\n- [Dennis Koch](https://github.com/pxlrbt)\n- [All Contributors](../../contributors)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpxlrbt%2Ffilament-environment-indicator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpxlrbt%2Ffilament-environment-indicator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpxlrbt%2Ffilament-environment-indicator/lists"}