litermi / error-notification
错误通知是一个在发生错误时发送通知的包
1.0.25
2024-05-08 18:23 UTC
Requires
- php: ^8.0
- guzzlehttp/guzzle: ^6.3.1|^7.0.1
- illuminate/bus: ^7.20|^8.19|^9.0|^10.0|^11.0
- illuminate/config: ^7.20|^8.19|^9.0|^10.0|^11.0
- illuminate/contracts: ^7.20|^8.19|^9.0|^10.0|^11.0
- illuminate/database: ^7.20|^8.19|^9.0|^10.0|^11.0
- illuminate/http: ^7.20|^8.19|^9.0|^10.0|^11.0
- illuminate/notifications: ^7.20|^8.19|^9.0|^10.0|^11.0
- illuminate/support: ^7.20|^8.19|^9.0|^10.0|^11.0
- laravel/slack-notification-channel: ^2.3|^3.2
- litermi/logs: ^1.0
This package is auto-updated.
Last update: 2024-09-08 18:59:10 UTC
README
关于
错误通知
是一个在发生错误时发送通知的包。
如何创建 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。