samsmithcodes/environment-banner
最新稳定版本:1.1.0
Composer 安装命令:
composer require samsmithcodes/environment-banner
包简介
Display a banner to indicate the current environment.
关键字:
README 文档
README
This package adds a banner to your applications UI to display the current environment.
We have all have a moment where we confuse the environment we are in, maybe you accidentally did something on the production system that should have been done on UAT, or you just want to indicate to end users which environment they are using.
Assumptions
This package assumes you are using Tailwind for your styling, so out of the box it uses Tailwind classes but of course you can customize this to fit your needs if you publish the view files.
Installing
To install this package, run the following composer command:
composer require samsmithcodes/environment-banner
Publish Files
You can publish the config and view files to your application for customization, just run the following commands:
php artisan vendor:publish --tag=environment-banner-config
php artisan vendor:publish --tag=environment-banner-view
Rendering The Banner
To render the banner in your application, include the following component.
<x-environment-banner />
Tailwind Classes
Because we set the color classes at runtime, Tailwind will not know about them, so to ensure Tailwind includes them, you should add them to the safe list, for example, in Tailwind v4 you can do this by adding the following to your app.css:
@source inline("bg-green-300 dark:bg-green-600");
Obviously define the classes you intend to use and then build your assets.
Development
To develop the package, you should first setup a clean Laravel project and then create a new directory called packages/samsmithcodes/environment-banner.
Then, checkout this repository into that directory.
git clone git@github.com:samsmithcodes/environment-banner.git
Install the package dependencies with composer install.
To install the package to test, go back to the root of the Laravel project you setup and add the following to the composer.json file.
"repositories": [
{
"type": "path",
"url": "./packages/samsmithcodes/environment-banner",
"options": {
"symlink": true
}
}
],
Then, run the following composer command to install the package.
composer require samsmithcodes/environment-banner:@dev
统计信息
- 总下载量: 11
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-07-16
