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、
Package info
github.com/guanguans/laravel-exception-notify
pkg:composer/guanguans/laravel-exception-notify
Fund package maintenance!
Requires
- php: >=8.1
- guanguans/notify: ^4.1
- laravel/framework: ^10.50 || ^11.0 || ^12.0 || ^13.0
Requires (Dev)
- adamwojs/php-cs-fixer-phpdoc-force-fqcn: ^2.0
- adhocore/json-fixer: ^1.0
- bamarni/composer-bin-plugin: ^1.9
- brainmaestro/composer-git-hooks: ^3.0
- driftingly/rector-laravel: ^2.2
- ergebnis/composer-normalize: ^2.50
- ergebnis/license: ^2.7
- ergebnis/php-cs-fixer-config: ^6.60
- ergebnis/phpstan-rules: ^2.13
- ergebnis/rector-rules: ^1.15
- guanguans/php-cs-fixer-custom-fixers: ^1.2
- guanguans/phpstan-rules: ^1.1
- guanguans/rector-rules: ^1.7
- jbelien/phpstan-sarif-formatter: ^1.2
- laravel/facade-documenter: dev-main
- mockery/mockery: ^1.6
- nette/utils: ^4.0
- nicksdot/phpstan-phpstorm-error-identifiers: ^0.3
- orchestra/testbench: ^8.37 || ^9.0 || ^10.0 || ^11.0
- pestphp/pest: ^2.36 || ^3.0 || ^4.0
- pestphp/pest-plugin-arch: ^2.7 || ^3.0 || ^4.0
- pestphp/pest-plugin-laravel: ^2.4 || ^3.0 || ^4.0
- pestphp/pest-plugin-profanity: ^1.7 || ^2.0 || ^3.0 || ^4.0
- php-mock/php-mock-phpunit: ^2.15
- phpstan/extension-installer: ^1.4
- phpstan/phpstan: ^2.1
- phpstan/phpstan-deprecation-rules: ^2.0
- phpstan/phpstan-mockery: ^2.0
- phpstan/phpstan-strict-rules: ^2.0
- phpstan/phpstan-webmozart-assert: ^2.0
- phpunit/phpunit: ^10.5 || ^11.0 || ^12.0 || ^13.0
- povils/phpmnd: ^3.6
- rector/argtyper: ^0.6
- rector/jack: ^0.5
- rector/rector: ^2.3
- rector/swiss-knife: ^2.3
- rector/type-perfect: ^2.1
- shipmonk/composer-dependency-analyser: ^1.8
- shipmonk/dead-code-detector: ^0.15
- shipmonk/name-collision-detector: ^2.1
- shipmonk/phpstan-baseline-per-identifier: ^2.3
- shipmonk/phpstan-rules: ^4.3
- sidz/phpstan-rules: ^0.5
- spatie/invade: ^2.1
- spatie/laravel-image-optimizer: ^1.8
- spaze/phpstan-disallowed-calls: ^4.9
- staabm/annotate-pull-request-from-checkstyle: ^1.8
- staabm/phpstan-todo-by: ^0.3
- staabm/side-effects-detector: ^1.0
- symfony/thanks: ^1.4
- symplify/phpstan-rules: ^14.9
- tomasvotruba/class-leak: ^2.1
- tomasvotruba/cognitive-complexity: ^1.0
- tomasvotruba/ctor: ^2.2
- tomasvotruba/type-coverage: ^2.1
- tomasvotruba/unused-public: ^2.2
- yamadashy/phpstan-friendly-formatter: ^1.4
- dev-main / 6.x-dev
- 6.1.0
- 6.0.1
- 6.0.0
- 5.x-dev
- 5.3.0
- 5.2.2
- 5.2.1
- 5.2.0
- 5.1.11
- 5.1.10
- 5.1.9
- 5.1.8
- 5.1.7
- 5.1.6
- 5.1.5
- 5.1.4
- 5.1.3
- 5.1.2
- 5.1.1
- 5.1.0
- 5.0.0
- 5.0.0-rc1
- 5.0.0-beta2
- 5.0.0-beta1
- 4.x-dev
- 4.7.0
- 4.6.0
- 4.5.1
- 4.5.0
- 4.4.2
- 4.4.1
- 4.4.0
- 4.3.3
- 4.3.2
- 4.3.1
- 4.3.0
- 4.2.0
- 4.1.0
- 4.0.0
- 4.0.0-beta3
- 4.0.0-beta2
- 4.0.0-beta1
- 3.x-dev
- 3.8.4
- 3.8.3
- 3.8.2
- 3.8.1
- 3.8.0
- 3.7.0
- 3.6.1
- 3.6.0
- 3.5.3
- 3.5.2
- 3.5.1
- 3.5.0
- 3.4.2
- 3.4.1
- 3.4.0
- 3.3.2
- 3.3.1
- 3.3.0
- 3.2.3
- 3.2.2
- 3.2.1
- 3.2.0
- 3.1.4
- 3.1.3
- 3.1.2
- 3.1.1
- 3.1.0
- 3.0.2
- 3.0.1
- 3.0.0
- 3.0.0-rc2
- 3.0.0-rc1
- 3.0.0-beta1
- 2.x-dev
- v2.16.0
- v2.15.0
- v2.14.4
- v2.14.3
- v2.14.2
- v2.14.1
- v2.14.0
- v2.13.0
- v2.12.0
- v2.11.5
- v2.11.4
- v2.11.3
- v2.11.2
- v2.11.1
- v2.11.0
- v2.10.0
- v2.9.0
- v2.8.0
- v2.7.1
- v2.7.0
- v2.6.3
- v2.6.2
- v2.6.1
- v2.6.0
- v2.5.1
- v2.5.0
- v2.4.0
- v2.3.0
- v2.2.0
- v2.1.3
- v2.1.2
- v2.1.1
- v2.1.0
- v2.0.8
- v2.0.7
- v2.0.6
- v2.0.5
- v2.0.4
- v2.0.3
- v2.0.2
- v2.0.1
- v2.0.0
- 1.x-dev
- v1.2.3
- v1.2.2
- v1.2.1
- v1.2.0
- v1.1.12
- v1.1.11
- v1.1.10
- v1.1.9
- v1.1.8
- v1.1.7
- v1.1.6
- v1.1.5
- v1.1.4
- v1.1.3
- v1.1.2
- v1.1.1
- v1.1.0
- v1.0.7
- v1.0.6
- v1.0.5
- v1.0.4
- v1.0.3
- v1.0.2
- v1.0.1
- v1.0.0
This package is auto-updated.
Last update: 2026-03-24 11:56:34 UTC
README
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).
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
Requirement
- PHP >= 8.1
Installation
composer require guanguans/laravel-exception-notify --ansi -v
Configuration
Publish files(optional)
php artisan vendor:publish --provider="Guanguans\\LaravelExceptionNotify\\ExceptionNotifyServiceProvider" --ansi -v
Apply for channel authentication information
- Notify(30+)
- Log
- Stack
Configure channels in the config/exception-notify.php 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
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
Skip report
bootstrap/app.php
<?php use Illuminate\Foundation\Application; use Illuminate\Foundation\Configuration\Exceptions; return Application::configure(basePath: \dirname(__DIR__)) ->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 use Guanguans\LaravelExceptionNotify\Facades\ExceptionNotify; public function boot(): void { ExceptionNotify::skipWhen(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)); }
Extend channel
app/Providers/AppServiceProvider.php
<?php use Guanguans\LaravelExceptionNotify\Contracts\ChannelContract; use Guanguans\LaravelExceptionNotify\Facades\ExceptionNotify; use Illuminate\Container\Container; public function boot(): void { ExceptionNotify::extend('YourChannelName', function (Container $container): ChannelContract { return 'Instance of the `Guanguans\LaravelExceptionNotify\Contracts\ChannelContract`.'; }); }
Composer scripts
composer checks:required
composer php-cs-fixer:fix
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
Thanks
License
The MIT License (MIT). Please see License File for more information.






