hanson/laravel-work-exception is a Laravel package.
It currently has 13 GitHub stars and 3.778 downloads on Packagist (latest version 1.0.0).
Install it with composer require hanson/laravel-work-exception.
Discover more Laravel packages by hanson
or browse all Laravel packages to compare alternatives.
Last updated
使用企业微信通知你的系统异常
composer install hanson/wechat-work-exception:dev-master -vvv
生成 wor_exception.php 配置
php artisan vendor:publish --tag=work-exception
修改 work 底下的配置 (需要在企业微信后台创建“自建应用”)
执行
php artisan work:chat
根据提示一步一步去创建群聊,并且复制创建成功后的 chat id,黏贴到 work.chatid 的配置
在 laravel 的 Handler 类下
use Hanson\WorkException\WorkExceptionHelper;
// ...
public function report(Exception $exception)
{
// 不输出 trace 信息
(new WorkExceptionHelper())->handle($exception);
// 输出 trace 信息
(new WorkExceptionHelper())->withTrace()->handle($exception);
parent::report($exception);
}