Skip to content

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

License

Notifications You must be signed in to change notification settings

guanguans/laravel-exception-notify

Folders and files

NameName
Last commit message
Last commit date
Mar 18, 2025
Mar 4, 2025
Mar 22, 2025
Mar 23, 2025
Mar 22, 2025
Mar 23, 2025
Mar 23, 2025
Mar 21, 2025
Apr 18, 2024
Mar 19, 2025
Mar 22, 2025
Mar 19, 2025
Mar 7, 2025
Mar 22, 2025
Mar 1, 2025
Mar 22, 2025
Mar 21, 2025
Mar 10, 2025
Mar 19, 2025
Mar 22, 2025
Mar 21, 2025
Mar 22, 2025
Mar 10, 2025
Mar 22, 2025

Repository files navigation

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、WeWork、WPush、XiZhi、YiFengChuanHua、Zulip).

tests check & fix styling codecov Latest Stable Version GitHub release (with filter) Total Downloads License

Related Links

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
  • Mail

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

Testing for exception notify

php artisan exception-notify:test --ansi -v

Notification examples

details
discord slack telegram
discord slack telegram
lark mail weWork
lark mail weWork

Skip report

Modify the boot method in the app/Providers/AppServiceProvider.php file

<?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

Modify the boot method in the app/Providers/AppServiceProvider.php file

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

About

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

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages