wujunze/dingtalk-exception

通过钉钉通知Laravel异常

2.2 2021-12-20 07:20 UTC

This package is auto-updated.

Last update: 2024-09-20 13:36:09 UTC


README

通过钉钉通知Laravel/Lumen异常

Latest Stable Version Total Downloads License

灵感与感谢

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);
    }

}

file

配置

简单类型


use Wujunze\DingTalkException\DingTalkExceptionHelper;

class Handler extends ExceptionHandler
{
  // ...
  
    public function report(Exception $exception)
    {
        DingTalkExceptionHelper::notify($exception, true);
        parent::report($exception);
    }

}