defstudio / env-alert

当您的用户处于生产环境时,显示漂亮的红色警报横幅

v1.2.0 2024-03-20 15:40 UTC

This package is auto-updated.

Last update: 2024-09-08 05:14:38 UTC


README

Latest Version on Packagist Tests Code Style Static Analysis Total Downloads License

(仅您)处于生产环境时,显示漂亮的红色警报横幅

image

安装

您可以通过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)。请参阅许可证文件获取更多信息。