PHPackages                             guanguans/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. [Logging &amp; Monitoring](/categories/logging)
4. /
5. guanguans/laravel-exception-notify

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

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).

7.0.2(3mo ago)14845.8k↑24.7%131MITPHPPHP &gt;=8.2CI passing

Since Jul 3Pushed 3w ago2 watchersCompare

[ Source](https://github.com/guanguans/laravel-exception-notify)[ Packagist](https://packagist.org/packages/guanguans/laravel-exception-notify)[ Docs](https://github.com/guanguans/laravel-exception-notify)[ Fund](https://guanguans.github.io/sponsors)[ RSS](/packages/guanguans-laravel-exception-notify/feed)WikiDiscussions main Synced 2d ago

READMEChangelog (10)Dependencies (159)Versions (155)Used By (1)

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

[](#laravel-exception-notify)

[![usage](docs/ntfy.jpg "usage")](docs/ntfy.jpg)

> 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).

[![tests](https://github.com/guanguans/laravel-exception-notify/actions/workflows/tests.yml/badge.svg)](https://github.com/guanguans/laravel-exception-notify/actions/workflows/tests.yml)[![php-cs-fixer](https://github.com/guanguans/laravel-exception-notify/actions/workflows/php-cs-fixer.yml/badge.svg)](https://github.com/guanguans/laravel-exception-notify/actions/workflows/php-cs-fixer.yml)[![codecov](https://camo.githubusercontent.com/0bb0183c2d095501bdebbf192bf46a1f9b946876136ab374f19bef8755675710/68747470733a2f2f636f6465636f762e696f2f67682f6775616e6775616e732f6c61726176656c2d657863657074696f6e2d6e6f746966792f6272616e63682f6d61696e2f67726170682f62616467652e7376673f746f6b656e3d55524746415753365334)](https://codecov.io/gh/guanguans/laravel-exception-notify)[![Latest Stable Version](https://camo.githubusercontent.com/cd8f8b281aa5f737202f548d12b5d57a90ef2584f0434b750a5faf4e351d34b2/68747470733a2f2f706f7365722e707567782e6f72672f6775616e6775616e732f6c61726176656c2d657863657074696f6e2d6e6f746966792f76)](https://packagist.org/packages/guanguans/laravel-exception-notify)[![GitHub release (with filter)](https://camo.githubusercontent.com/1058e726bf61d103529870f0dc69e72a0bce3991b545aa3b7e5d7afdeb7539d5/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f6775616e6775616e732f6c61726176656c2d657863657074696f6e2d6e6f74696679)](https://github.com/guanguans/laravel-exception-notify/releases)[![Total Downloads](https://camo.githubusercontent.com/039509fbeeb2b3fe39cea8b739ad892c92a37d570af3d42b85f69d2b077bdf44/68747470733a2f2f706f7365722e707567782e6f72672f6775616e6775616e732f6c61726176656c2d657863657074696f6e2d6e6f746966792f646f776e6c6f616473)](https://packagist.org/packages/guanguans/laravel-exception-notify)[![License](https://camo.githubusercontent.com/d2ea4e1405ab8f73eefff8114d46fab657574e4758b2e9e387e7c2071454c84a/68747470733a2f2f706f7365722e707567782e6f72672f6775616e6775616e732f6c61726176656c2d657863657074696f6e2d6e6f746966792f6c6963656e7365)](https://packagist.org/packages/guanguans/laravel-exception-notify)

Why?
----

[](#why)

When an exception occurs, we want to be notified immediately, so that we can fix the problem as soon as possible. This package provides a simple and flexible way to monitor exceptions and report them to the notification channels.

Related repositories
--------------------

[](#related-repositories)

-
-

Requirement
-----------

[](#requirement)

- PHP &gt;= 8.2

Installation
------------

[](#installation)

```
composer require guanguans/laravel-exception-notify --ansi -v
```

Configuration
-------------

[](#configuration)

### Publish files(optional)

[](#publish-filesoptional)

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

### Apply for channel authentication information

[](#apply-for-channel-authentication-information)

- [Notify(30+)](https://github.com/guanguans/notify)
- Log
- Mail
- Stack

### Configure channels in the `config/exception-notify.php` and `.env` file

[](#configure-channels-in-the-configexception-notifyphp-and-env-file)

```
#EXCEPTION_NOTIFY_CHANNEL=stack
EXCEPTION_NOTIFY_STACK_CHANNELS=log,mail,slack
EXCEPTION_NOTIFY_MAIL_TO_ADDRESS=developer1@example.mail,developer2@example.mail
EXCEPTION_NOTIFY_SLACK_WEBHOOK=https://hooks.slack.com/services/TPU9A9/B038KNUC0GY/6pKH3vfa3mjlUPcgLSjzR
```

Usage
-----

[](#usage)

### Test whether exception can be monitored and reported to notification channel

[](#test-whether-exception-can-be-monitored-and-reported-to-notification-channel)

```
php artisan exception-notify:test --channel=log --job-connection=sync
php artisan exception-notify:test
php artisan exception-notify:test -v
```

### 📸 Notification examples

[](#camera_flash-notification-examples)

🧐 detailsdiscordslacktelegram[![discord](docs/discord.jpg)](docs/discord.jpg)[![slack](docs/slack.jpg)](docs/slack.jpg)[![telegram](docs/telegram.jpg)](docs/telegram.jpg)larkmailweWork[![lark](docs/lark.jpg)](docs/lark.jpg)[![mail](docs/mail.jpg)](docs/mail.jpg)[![weWork](docs/weWork.jpg)](docs/weWork.jpg)### Skip report

[](#skip-report)

bootstrap/app.php```
