# laravel-exception-notify
**Repository Path**: guanguans/laravel-exception-notify
## Basic Information
- **Project Name**: laravel-exception-notify
- **Description**: Monitor exception and report it to notification channels(Dump、Log、Mail、AnPush、Bark、Chanify、DingTalk、Discord、Gitter、GoogleChat、IGot、Lark、Mattermost、MicrosoftTeams、NowPush、Ntfy、Push、Pushback...)
- **Primary Language**: PHP
- **License**: MIT
- **Default Branch**: main
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 2
- **Forks**: 1
- **Created**: 2021-07-06
- **Last Updated**: 2025-09-05
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# laravel-exception-notify

> Monitor exception and report to the notification channels(Dump、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、Zulip).
[](https://github.com/guanguans/laravel-exception-notify/actions)
[](https://github.com/guanguans/laravel-exception-notify/actions)
[](https://codecov.io/gh/guanguans/laravel-exception-notify)
[](https://packagist.org/packages/guanguans/laravel-exception-notify)
[](https://github.com/guanguans/laravel-exception-notify/releases)
[](https://packagist.org/packages/guanguans/laravel-exception-notify)
[](https://packagist.org/packages/guanguans/laravel-exception-notify)
## Related repositories
* [https://github.com/guanguans/notify](https://github.com/guanguans/notify)
* [https://github.com/guanguans/yii-log-target](https://github.com/guanguans/yii-log-target)
## Requirement
* PHP >= 8.0
## Installation
```bash
composer require guanguans/laravel-exception-notify --ansi -v
```
## Configuration
### Publish files(optional)
```bash
php artisan vendor:publish --provider="Guanguans\\LaravelExceptionNotify\\ExceptionNotifyServiceProvider" --ansi -v
```
### Apply for channel authentication information
* [Notify(30+)](https://github.com/guanguans/notify)
* Dump(for debugging exception report)
* Log
* Mail
### Configure channels in the `config/exception-notify.php` and `.env` file
```dotenv
EXCEPTION_NOTIFY_CHANNEL=stack
EXCEPTION_NOTIFY_STACK_CHANNELS=log,slack,weWork
EXCEPTION_NOTIFY_SLACK_WEBHOOK=https://hooks.slack.com/services/TPU9A9/B038KNUC0GY/6pKH3vfa3mjlUPcgLSjzR
EXCEPTION_NOTIFY_WEWORK_TOKEN=73a3d5a3-ceff-4da8-bcf3-ff5891778
```
## Usage
### Test whether exception can be monitored and reported to notification channel
```shell
php artisan exception-notify:test --channel=dump --job-connection=sync
php artisan exception-notify:test
php artisan exception-notify:test -v
```
### :camera_flash: Notification examples
:monocle_face: details
| discord | slack | telegram |
|:----------------------------:|:------------------------:|:------------------------------:|
|  |  |  |
| lark | mail | weWork |
|  |  |  |
### Skip report
`app/Providers/AppServiceProvider.php`
```php
Arr::first(
[
\Symfony\Component\HttpKernel\Exception\HttpException::class,
\Illuminate\Http\Exceptions\HttpResponseException::class,
],
static fn (string $exception): bool => $throwable instanceof $exception
));
}
```
### Extend channel
`app/Providers/AppServiceProvider.php`
```php