V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
爱意满满的作品展示区。
wujunze
V2EX  ›  分享创造

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

  •  
  •   wujunze · 2018-07-27 09:12:57 +08:00 · 2146 次点击
    这是一个创建于 2098 天前的主题,其中的信息可能已经有所发展或是发生改变。

    看了 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-07-27 09:23:03 +08:00
    找了有 3 分钟没有找到...
    对自己的搜索能力这么有自信?
    gaodeng
        2
    gaodeng  
       2018-07-27 19:24:03 +08:00   ❤️ 1
    cool
    wujunze
        3
    wujunze  
    OP
       2018-07-27 19:31:34 +08:00
    @gaodeng #2 谢谢 欢迎使用 分享
    mingyun
        4
    mingyun  
       2018-07-27 23:21:32 +08:00
    大佬 20 分钟就写一个包,666
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5407 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 06:54 · PVG 14:54 · LAX 23:54 · JFK 02:54
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.