defstudio / env-alert
当您的用户处于生产环境时,显示漂亮的红色警报横幅
v1.2.0
2024-03-20 15:40 UTC
Requires
- php: ^8.2
- illuminate/contracts: ^10.0|^11.0
- illuminate/support: ^v10.0|^11.0
- spatie/laravel-package-tools: ^1.14.0
Requires (Dev)
- laravel/pint: ^1.0
- nunomaduro/collision: ^7.9
- nunomaduro/larastan: ^2.0.1
- orchestra/testbench: ^8.0
- pestphp/pest: ^2.0
- pestphp/pest-plugin-arch: ^2.0
- pestphp/pest-plugin-laravel: ^2.0
- phpstan/extension-installer: ^1.1
- phpstan/phpstan-deprecation-rules: ^1.0
- phpstan/phpstan-phpunit: ^1.0
- rector/rector: ^0.15.19
- spatie/laravel-ray: ^1.26
- spatie/pest-plugin-snapshots: ^2.0
README
当您(仅您)处于生产环境时,显示漂亮的红色警报横幅
安装
您可以通过composer安装此包
composer require defstudio/env-alert
您应该使用以下命令发布配置文件
php artisan vendor:publish --tag="env-alert-config"
这是发布配置文件的内容
return [ 'enabled' => (bool) env('ENV_ALERT_ENABLED', true), /* * Current environment, taken from APP_ENV or ENV_ALERT_ENV .env entries */ 'current_environment' => env('ENV_ALERT_ENV', env('APP_ENV', 'production')), /* * Environments where to show the ribbon alert */ 'environments' => [ 'production' => [ /* * When to display the ribbon alert. */ 'filters' => [ 'email' => [ // 'your.email@email.test', // '*@your.company.com' ], 'ip' => [ // '123.456.789.101' ], ], /* * The ribbon style */ 'style' => [ 'position' => 'right', 'background_color' => '#f30b0b', 'text_color' => '#ffffff', ], ], ], 'service_class' => \DefStudio\EnvAlert\AlertService::class, ];
这就完成了,屏幕右上角的红横幅将在您处于生产环境时发出警告!
测试
composer test
变更日志
请参阅变更日志了解最近的变化。请关注我们的Twitter@FabioIvona获取更多更新。
贡献
请参阅贡献指南获取详细信息。
安全漏洞
请查看我们的安全策略了解如何报告安全漏洞。
鸣谢
许可证
MIT许可证(MIT)。请参阅许可证文件获取更多信息。