litermi/error-notification

错误通知是一个在发生错误时发送通知的包

1.0.25 2024-05-08 18:23 UTC

README

Software License

关于

错误通知是一个在发生错误时发送通知的包。

如何创建 composer 包的教程

安装

在您的 composer.json 文件中添加 litermi/error-notification 包并更新依赖项

composer require litermi/error-notification

配置

设置提供者

'providers' => [
    // ...
    Litermi\ErrorNotification\Providers\ServiceProvider::class,
],

默认设置在 config/error-notification.php 中。发布配置以将文件复制到您自己的配置文件中

php artisan vendor:publish --provider="Litermi\ErrorNotification\Providers\ServiceProvider"

注意:这是必须的,以便您可以更改默认配置

使用方法

SendEmailNotificationService::execute($exception, $directNotification);
SendSlackNotificationService::execute($exception, $directNotification, $channelSlack);

在 app/Console/Kernel.php 中添加

protected $commands = [
    SendGroupNotificationScheduler::class,
];


$schedule->command('error-notification:send-group-notification')
    ->withoutOverlapping()
    ->everyFiveMinutes()
    ->sendOutputTo('/dev/stdout');

许可证

在 MIT 许可证下发布,请参阅 LICENSE