cirelramos/error-notification

错误通知是一个包,当发生错误时会发送通知。

1.0.7 2023-01-03 19:55 UTC

This package is auto-updated.

Last update: 2024-09-30 01:35:47 UTC


README

Software License

关于

错误通知是一个包,当发生错误时会发送通知。

如何创建composer包的教程

安装

在您的composer.json文件中要求安装cirelramos/error-notification包,并更新您的依赖项

composer require cirelramos/error-notification

配置

设置提供商

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

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

php artisan vendor:publish --provider="Cirelramos\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