jinfeng333
V2EX  ›  分享创造

使用钉钉通知你的 Laravel 框架系统异常

By jinfeng333 at 2018 年 7 月 27 日 · 2867 次点击

看了 Hanson 兄弟的倍洽通知异常

我们团队主要用钉钉,就想找个 Laravel 的钉钉通知异常的包,最好是安装后开箱即用的。

在 Google 和 GitHub 上找了有 3 分钟还是没有找到能开箱即用的,于是自己动手丰衣足食。

花了 20 分钟"写"(chao)了一个 Laravel 钉钉通知异常的包 wujunze/dingtalk-exception

食用方法

安装

composer require wujunze/dingtalk-exception

发布配置文件

php artisan vendor:publish --provider="DingNotice\DingNoticeServiceProvider

配置 Handler

app/Exceptions/Handler.php

use Wujunze\DingTalkException\DingTalkExceptionHelper;

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

}

记得配置你的 config/ding.php

效果如下

file

GitHub 仓库: https://github.com/wujunze/dingtalk-exception

Inspire And Thanks

cblink/bearychat-exception
wowiwj/ding-notice

Thanks

4 条回复  •  2018-07-27 23:21:32 +08:00
jianpanxia
   1
jianpanxia  
   2018 年 7 月 27 日
找了有 3 分钟没有找到...
对自己的搜索能力这么有自信?
gaodeng
   2
gaodeng  
   2018 年 7 月 27 日   ❤️ 1
cool
jinfeng333
   3
jinfeng333  
OP
   2018 年 7 月 27 日
@gaodeng #2 谢谢 欢迎使用 分享
mingyun
   4
mingyun  
   2018 年 7 月 27 日
大佬 20 分钟就写一个包,666
爱意满满的作品展示区。
© 2026 V2EX · 30ms · 3.9.8.5