https://github.com/guanguans/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
bark chanify discord error exception laravel monitor notification notifier notify pushdeer qq-bot slack telegram
Last synced: 5 months ago
JSON representation
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).
- Host: GitHub
- URL: https://github.com/guanguans/laravel-exception-notify
- Owner: guanguans
- License: mit
- Created: 2021-07-02T06:31:13.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2025-03-26T13:09:28.000Z (6 months ago)
- Last Synced: 2025-05-10T15:52:06.569Z (5 months ago)
- Topics: bark, chanify, discord, error, exception, laravel, monitor, notification, notifier, notify, pushdeer, qq-bot, slack, telegram
- Language: PHP
- Homepage:
- Size: 14.4 MB
- Stars: 133
- Watchers: 3
- Forks: 13
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: .github/CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: .github/CODE_OF_CONDUCT.md
- Security: .github/SECURITY.md
Awesome Lists containing this project
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### 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