cirelramos / error-notification
错误通知是一个包,当发生错误时会发送通知。
1.0.7
2023-01-03 19:55 UTC
Requires
- php: ^8.0
- cirelramos/logs: ^1.0
- guzzlehttp/guzzle: ^6.3.1|^7.0.1
- illuminate/bus: ^7.20|^8.19|^9.0
- illuminate/config: ^7.20|^8.19|^9.0
- illuminate/contracts: ^7.20|^8.19|^9.0
- illuminate/database: ^7.20|^8.19|^9.0
- illuminate/http: ^7.20|^8.19|^9.0
- illuminate/notifications: ^7.20|^8.19|^9.0
- illuminate/support: ^7.20|^8.19|^9.0
- laravel/slack-notification-channel: ^2.3
README
关于
错误通知是一个包,当发生错误时会发送通知。
如何创建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。