wujunze / dingtalk-exception
通过钉钉通知Laravel异常
2.2
2021-12-20 07:20 UTC
Requires
- php: ^7.0
- wangju/ding-notice: ^1.0
Requires (Dev)
- laravel/framework: ^5.6|6.20.26
- phpunit/phpunit: ^6.5
This package is auto-updated.
Last update: 2024-09-20 13:36:09 UTC
README
通过钉钉通知Laravel/Lumen异常
灵感与感谢
cblink/bearychat-exception
wowiwj/ding-notice
安装
composer require wujunze/dingtalk-exception
将服务提供者添加到config/app.php中的providers
数组中
DingNotice\DingNoticeServiceProvider::class,
发布配置文件
php artisan vendor:publish --provider="DingNotice\DingNoticeServiceProvider"
用法
修复文件app/Exceptions/Handler.php
use Wujunze\DingTalkException\DingTalkExceptionHelper;
class Handler extends ExceptionHandler
{
// ...
public function report(Exception $exception)
{
DingTalkExceptionHelper::notify($exception);
parent::report($exception);
}
}
配置
简单类型
use Wujunze\DingTalkException\DingTalkExceptionHelper;
class Handler extends ExceptionHandler
{
// ...
public function report(Exception $exception)
{
DingTalkExceptionHelper::notify($exception, true);
parent::report($exception);
}
}