GitPedia

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).

From guanguans·Updated June 19, 2026·View on GitHub·

> 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). The project is written primarily in PHP, distributed under the MIT License license, first published in 2021. Key topics include: bark, chanify, discord, error, exception.

Latest release: 7.0.2
April 2, 2026View Changelog →

laravel-exception-notify

<p align="center"><img src="docs/ntfy.jpg" width="100%" alt="usage" title="usage"></p>

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).

tests
php-cs-fixer
codecov
Latest Stable Version
GitHub release (with filter)
Total Downloads
License

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.

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

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

<details> <summary>:monocle_face: details</summary>
discordslacktelegram
discordslacktelegram
larkmailweWork
larkmailweWork
</details>

Skip report

<details> <summary>bootstrap/app.php</summary>
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();
</details> <details> <summary>Or app/Providers/AppServiceProvider.php</summary>
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)); }
</details>

Extend channel

<details> <summary>app/Providers/AppServiceProvider.php</summary>
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`.'; }); }
</details>

Composer scripts

shell
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.

Contributors

Showing top 7 contributors by commit count.

View all contributors on GitHub →

This article is auto-generated from guanguans/laravel-exception-notify via the GitHub API.Last fetched: 6/20/2026