https://github.com/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、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: 2 months ago
JSON representation
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、Zulip).
- Host: GitHub
- URL: https://github.com/guanguans/laravel-exception-notify
- Owner: guanguans
- License: mit
- Created: 2021-07-02T06:31:13.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2026-03-27T08:14:40.000Z (2 months ago)
- Last Synced: 2026-03-29T21:51:42.816Z (2 months ago)
- Topics: bark, chanify, discord, error, exception, laravel, monitor, notification, notifier, notify, pushdeer, qq-bot, slack, telegram
- Language: PHP
- Homepage:
- Size: 15.8 MB
- Stars: 146
- Watchers: 2
- Forks: 13
- Open Issues: 0
-
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(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).
[](https://github.com/guanguans/laravel-exception-notify/actions/workflows/tests.yml)
[](https://github.com/guanguans/laravel-exception-notify/actions/workflows/php-cs-fixer.yml)
[](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)
## 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
* [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.2
## Installation
```shell
composer require guanguans/laravel-exception-notify --ansi -v
```
## Configuration
### Publish files(optional)
```shell
php artisan vendor:publish --provider="Guanguans\\LaravelExceptionNotify\\ExceptionNotifyServiceProvider" --ansi -v
```
### 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
```dotenv
#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
### Test whether exception can be monitored and reported to notification channel
```shell
php artisan exception-notify:test --channel=log --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
bootstrap/app.php
```php
withExceptions(static function (Exceptions $exceptions): void {
$exceptions
// ->dontReportWhen(static fn (Throwable $throwable) => collect([
// \Symfony\Component\HttpKernel\Exception\HttpException::class,
// \Illuminate\Http\Exceptions\HttpResponseException::class,
// ])->contains(static fn (string $exception): bool => $throwable instanceof $exception))
->dontReport([
\Symfony\Component\HttpKernel\Exception\HttpException::class,
\Illuminate\Http\Exceptions\HttpResponseException::class,
]);
})->create();
```
Or app/Providers/AppServiceProvider.php
```php
collect([
\Symfony\Component\HttpKernel\Exception\HttpException::class,
\Illuminate\Http\Exceptions\HttpResponseException::class,
])->contains(static fn (string $exception): bool => $throwable instanceof $exception));
}
```
### Extend channel
app/Providers/AppServiceProvider.php
```php
## Composer scripts
```shell
composer checks:required
composer php-cs-fixer:fix
composer test
```
## Changelog
Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.
## Contributing
Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.
## Security Vulnerabilities
Please review [our security policy](../../security/policy) on how to report security vulnerabilities.
## Credits
* [guanguans](https://github.com/guanguans)
* [All Contributors](../../contributors)
## Thanks
[](https://www.jetbrains.com/?from=https://github.com/guanguans)
## License
The MIT License (MIT). Please see [License File](LICENSE) for more information.