# 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

usage

> 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). [![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://codecov.io/gh/guanguans/laravel-exception-notify/branch/main/graph/badge.svg?token=URGFAWS6S4)](https://codecov.io/gh/guanguans/laravel-exception-notify) [![Latest Stable Version](https://poser.pugx.org/guanguans/laravel-exception-notify/v)](https://packagist.org/packages/guanguans/laravel-exception-notify) [![GitHub release (with filter)](https://img.shields.io/github/v/release/guanguans/laravel-exception-notify)](https://github.com/guanguans/laravel-exception-notify/releases) [![Total Downloads](https://poser.pugx.org/guanguans/laravel-exception-notify/downloads)](https://packagist.org/packages/guanguans/laravel-exception-notify) [![License](https://poser.pugx.org/guanguans/laravel-exception-notify/license)](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 | |:----------------------------:|:------------------------:|:------------------------------:| | ![discord](docs/discord.jpg) | ![slack](docs/slack.jpg) | ![telegram](docs/telegram.jpg) | | lark | mail | weWork | | ![lark](docs/lark.jpg) | ![mail](docs/mail.jpg) | ![weWork](docs/weWork.jpg) |
### 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