PHPackages                             wuhaohui/laravel-exception-notify - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Mail &amp; Notifications](/categories/mail)
4. /
5. wuhaohui/laravel-exception-notify

ActiveLibrary[Mail &amp; Notifications](/categories/mail)

wuhaohui/laravel-exception-notify
=================================

Laravel 中异常监控报警通知(Bark、Chanify、钉钉群机器人、Discord、飞书群机器人、邮件、PushDeer、QQ 频道机器人、Server 酱、Slack、Telegram、企业微信群机器人、息知)。

v0.0.1(2y ago)04MITPHPPHP &gt;=7.2

Since Jan 29Pushed 2y ago1 watchersCompare

[ Source](https://github.com/wuhaohui/laravel-exception-notify)[ Packagist](https://packagist.org/packages/wuhaohui/laravel-exception-notify)[ Docs](https://github.com/guanguans/laravel-exception-notify)[ Fund](https://www.guanguans.cn/images/wechat.jpeg)[ RSS](/packages/wuhaohui-laravel-exception-notify/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (31)Versions (2)Used By (0)

laravel-exception-notify
========================

[](#laravel-exception-notify)

[![usage](docs/usage.png)](docs/usage.png)

[简体中文](README.md) | [ENGLISH](README-EN.md)

> Laravel 中异常监控报警通知(Bark、Chanify、钉钉群机器人、Discord、飞书群机器人、邮件、PushDeer、QQ 频道机器人、Server 酱、Slack、Telegram、企业微信群机器人、息知)。

[![Tests](https://github.com/guanguans/laravel-exception-notify/workflows/Tests/badge.svg)](https://github.com/guanguans/laravel-exception-notify/actions)[![Check & fix styling](https://github.com/guanguans/laravel-exception-notify/workflows/Check%20&%20fix%20styling/badge.svg)](https://github.com/guanguans/laravel-exception-notify/actions)[![codecov](https://camo.githubusercontent.com/0bb0183c2d095501bdebbf192bf46a1f9b946876136ab374f19bef8755675710/68747470733a2f2f636f6465636f762e696f2f67682f6775616e6775616e732f6c61726176656c2d657863657074696f6e2d6e6f746966792f6272616e63682f6d61696e2f67726170682f62616467652e7376673f746f6b656e3d55524746415753365334)](https://codecov.io/gh/guanguans/laravel-exception-notify)[![Latest Stable Version](https://camo.githubusercontent.com/cd8f8b281aa5f737202f548d12b5d57a90ef2584f0434b750a5faf4e351d34b2/68747470733a2f2f706f7365722e707567782e6f72672f6775616e6775616e732f6c61726176656c2d657863657074696f6e2d6e6f746966792f76)](//packagist.org/packages/guanguans/laravel-exception-notify)[![Total Downloads](https://camo.githubusercontent.com/039509fbeeb2b3fe39cea8b739ad892c92a37d570af3d42b85f69d2b077bdf44/68747470733a2f2f706f7365722e707567782e6f72672f6775616e6775616e732f6c61726176656c2d657863657074696f6e2d6e6f746966792f646f776e6c6f616473)](//packagist.org/packages/guanguans/laravel-exception-notify)[![License](https://camo.githubusercontent.com/d2ea4e1405ab8f73eefff8114d46fab657574e4758b2e9e387e7c2071454c84a/68747470733a2f2f706f7365722e707567782e6f72672f6775616e6775616e732f6c61726176656c2d657863657074696f6e2d6e6f746966792f6c6963656e7365)](//packagist.org/packages/guanguans/laravel-exception-notify)

功能
--

[](#功能)

- 监控发送 laravel 应用异常
- 支持多种通道(Bark、Chanify、钉钉群机器人、Discord、飞书群机器人、邮件、PushDeer、QQ 频道机器人、Server 酱、Slack、Telegram、企业微信群机器人、息知)
- 支持扩展自定义通道
- 支持自定义数据收集器
- 支持自定义数据转换器
- 支持通知速率限制(相同异常生产环境默认每 5 分钟通知 1 次)

相关项目
----

[](#相关项目)

-
-

环境要求
----

[](#环境要求)

- PHP &gt;= 7.2
- laravel &gt;= 5.5

安装
--

[](#安装)

```
composer require guanguans/laravel-exception-notify -vvv
```

配置
--

[](#配置)

### 注册服务

[](#注册服务)

#### laravel

[](#laravel)

```
php artisan vendor:publish --provider="Guanguans\\LaravelExceptionNotify\\ExceptionNotifyServiceProvider"
```

#### lumen

[](#lumen)

将以下代码段添加到 `bootstrap/app.php` 文件中的 `Register Service Providers` 部分下：

```
$app->register(\Guanguans\LaravelExceptionNotify\ExceptionNotifyServiceProvider::class);
$app->boot(\Guanguans\LaravelExceptionNotify\ExceptionNotifyServiceProvider::class);
```

### 申请通道 token 等信息

[](#申请通道-token-等信息)

- [Bark](https://github.com/Finb/Bark)
- [Chanify](https://github.com/chanify?type=source)
- [钉钉群机器人](https://developers.dingtalk.com/document/app/custom-robot-access)
- [Discord](https://discord.com/developers/docs/resources/webhook#edit-webhook-message)
- [飞书群机器人](https://www.feishu.cn/hc/zh-CN/articles/360024984973)
- [PushDeer](http://pushdeer.com)
- [QQ 频道机器人](https://bot.q.qq.com/wiki/develop/api/openapi/message/post_messages.html)
- [Server 酱](https://sct.ftqq.com)
- [Slack](https://api.slack.com/messaging/webhooks)
- [Telegram](https://core.telegram.org/bots/api#sendmessage)
- [企业微信群机器人](https://work.weixin.qq.com/help?doc_id=13376)
- [息知](https://xz.qqoq.net/#/index)

### 配置文件中配置 token 等信息

[](#配置文件中配置-token-等信息)

`config/exception-notify.php`

`.env` 文件中配置

```
EXCEPTION_NOTIFY_DEFAULT_CHANNEL=dingTalk
EXCEPTION_NOTIFY_DINGTALK_KEYWORD=keyword
EXCEPTION_NOTIFY_DINGTALK_TOKEN=c44fec1ddaa8a833156efb77b7865d62ae13775418030d94d
EXCEPTION_NOTIFY_DINGTALK_SECRET=SECc32bb7345c0f73da2b9786f0f7dd5083bd768a29b82
```

使用
--

[](#使用)

### `app/Exceptions/Handler.php` 的 `report` 方法中添加

[](#appexceptionshandlerphp-的-report-方法中添加)

```
public function report(Exception $e)
{
    // 默认通道
    \ExceptionNotifier::reportIf($this->shouldReport($e), $e);
    // 指定通道
    \ExceptionNotifier::onChannel('dingTalk', 'mail')->reportIf($this->shouldReport($e), $e);

    parent::report($e);
}
```

### 通知结果(息知)

[](#通知结果息知)

[![息知](docs/xiZhi.jpg)](docs/xiZhi.jpg)

扩展自定义通道
-------

[](#扩展自定义通道)

`app/Providers/AppServiceProvider.php` 的 `boot` 方法中添加

```
public function boot()
{
    // 扩展自定义通道
    \ExceptionNotifier::extend('YourChannel', function (\Illuminate\Contracts\Container\Container $container){
        // 返回 \Guanguans\LaravelExceptionNotify\Contracts\Channel 的实例
    });
}
```

测试
--

[](#测试)

```
composer test
```

变更日志
----

[](#变更日志)

请参阅 [CHANGELOG](CHANGELOG.md) 获取最近有关更改的更多信息。

贡献指南
----

[](#贡献指南)

请参阅 [CONTRIBUTING](.github/CONTRIBUTING.md) 有关详细信息。

安全漏洞
----

[](#安全漏洞)

请查看[我们的安全政策](../../security/policy)了解如何报告安全漏洞。

贡献者
---

[](#贡献者)

- [guanguans](https://github.com/guanguans)
- [所有贡献者](../../contributors)

鸣谢
--

[](#鸣谢)

[![](https://camo.githubusercontent.com/3cf726e7cdadba47755b7f7ea4227945a92a2fa48aadf4a2573140ec6501c989/68747470733a2f2f7265736f75726365732e6a6574627261696e732e636f6d2f73746f726167652f70726f64756374732f636f6d70616e792f6272616e642f6c6f676f732f6a625f6265616d2e737667)](https://www.jetbrains.com/?from=https://github.com/guanguans)

协议
--

[](#协议)

MIT 许可证（MIT）。有关更多信息，请参见[协议文件](LICENSE)。

###  Health Score

15

—

LowBetter than 3% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity26

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

834d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4f7d71e1cc69f4916eb826068485d4b52a02f7a4f9bd1de70ef4c9dee6eedb81?d=identicon)[wuhaohui](/maintainers/wuhaohui)

---

Top Contributors

[![wuhaohui](https://avatars.githubusercontent.com/u/12210898?v=4)](https://github.com/wuhaohui "wuhaohui (5 commits)")

---

Tags

laravelsdkmailserverexceptionerrornotificationnotifierslacktelegrammonitornotifyqqdingtalkFeishudiscordserverChannoticeweworkBarkchanifyxiZhiPushDeer

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Psalm, Rector

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/wuhaohui-laravel-exception-notify/health.svg)

```
[![Health](https://phpackages.com/badges/wuhaohui-laravel-exception-notify/health.svg)](https://phpackages.com/packages/wuhaohui-laravel-exception-notify)
```

###  Alternatives

[guanguans/laravel-exception-notify

Monitor exception and report to the notification channels(Log、Mail、AnPush、Bark、Chanify、DingTalk、Discord、Gitter、GoogleChat、IGot、Lark、Mattermost、MicrosoftTeams、NowPush、Ntfy、Push、Pushback、PushBullet、PushDeer、PushMe、Pushover、PushPlus、QQ、RocketChat、ServerChan、ShowdocPush、SimplePush、Slack、Telegram、WeWork、WPush、XiZhi、YiFengChuanHua、ZohoCliq、ZohoCliqWebHook、Zulip).

14642.7k1](/packages/guanguans-laravel-exception-notify)[guanguans/notify

Push notification SDK(AnPush、Bark、Chanify、DingTalk、Discord、Gitter、GoogleChat、IGot、Lark、Mattermost、MicrosoftTeams、NowPush、Ntfy、Push、Pushback、PushBullet、PushDeer、PushMe、Pushover、PushPlus、QQ、RocketChat、ServerChan、ShowdocPush、SimplePush、Slack、Telegram、WeWork、WPush、XiZhi、YiFengChuanHua、ZohoCliq、ZohoCliqWebHook、Zulip).

682104.9k7](/packages/guanguans-notify)[laravel/scout

Laravel Scout provides a driver based solution to searching your Eloquent models.

1.7k49.4M479](/packages/laravel-scout)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k12.1M99](/packages/laravel-pulse)[laravel-notification-channels/telegram

Telegram Notifications Channel for Laravel

1.1k3.4M35](/packages/laravel-notification-channels-telegram)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
