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、We
Fund package maintenance!
Wechat
Installs: 28 920
Dependents: 1
Suggesters: 0
Security: 0
Stars: 130
Watchers: 3
Forks: 12
Open Issues: 0
Requires
- php: >=8.0
- guanguans/notify: ^3.2
- laravel/framework: ^9.52 || ^10.0 || ^11.0 || ^12.0
Requires (Dev)
- adhocore/json-fixer: ^1.0
- azjezz/psl: ^1.9 || ^2.0 || ^3.0
- bamarni/composer-bin-plugin: ^1.8
- brainmaestro/composer-git-hooks: ^3.0
- composer/semver: ^3.4
- cweagans/composer-patches: ^1.7
- driftingly/rector-laravel: ^2.0
- ergebnis/composer-normalize: ^2.45
- ergebnis/json-printer: ^3.7
- ergebnis/rector-rules: ^1.3
- guanguans/ai-commit: dev-main
- guanguans/monorepo-builder-worker: ^1.4
- laravel/facade-documenter: dev-main
- mockery/mockery: ^1.6
- nette/utils: ^4.0
- orchestra/testbench: ^7.53 || ^8.0 || ^9.0 || ^10.0
- pestphp/pest: ^1.23 || ^2.0 || ^3.0
- pestphp/pest-plugin-faker: ^1.0 || ^2.0 || ^3.0
- pestphp/pest-plugin-laravel: ^1.4 || ^2.0 || ^3.0
- php-mock/php-mock-phpunit: ^2.13
- phpstan/extension-installer: ^1.4
- phpstan/phpstan: ^2.1
- phpstan/phpstan-deprecation-rules: ^2.0
- phpstan/phpstan-webmozart-assert: ^2.0
- rector/rector: ^2.0
- rector/swiss-knife: ^2.1
- rector/type-perfect: ^2.0
- shipmonk/composer-dependency-analyser: ^1.8
- shipmonk/phpstan-baseline-per-identifier: ^2.1
- spatie/pest-plugin-snapshots: ^1.1 || ^2.0
- spaze/phpstan-disallowed-calls: ^4.4
- symplify/phpstan-extensions: ^12.0
- symplify/phpstan-rules: ^14.4
- symplify/vendor-patches: ^11.4
- tomasvotruba/class-leak: ^2.0
- tomasvotruba/type-coverage: ^2.0
- yamadashy/phpstan-friendly-formatter: ^1.2
- dev-main / 5.x-dev
- 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: 2025-03-26 13:09:31 UTC
README
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).
Related repositories
Requirement
- PHP >= 8.0
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+)
- Dump(for debugging exception report)
- Log
Configure channels in the config/exception-notify.php
and .env
file
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
php artisan exception-notify:test --channel=dump --job-connection=sync php artisan exception-notify:test php artisan exception-notify:test -v
📸 Notification examples
Skip report
app/Providers/AppServiceProvider.php
<?php use Guanguans\LaravelExceptionNotify\Facades\ExceptionNotify; use Illuminate\Support\Arr; public function boot(): void { ExceptionNotify::skipWhen(static fn (\Throwable $throwable) => 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 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`.'; }); }
Testing
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.