myopensoft/laravel-kepoh-telegram

To send error that been triggered by exception to Telegram public channels for internal error logging purpose.

1.0.1 2021-03-25 08:51 UTC

This package is auto-updated.

Last update: 2024-04-25 15:57:53 UTC


README

Latest Version on Packagist Total Downloads

To send error that been triggered by exception to Telegram public channels for internal error logging purpose.

Installation

You can install the package via composer:

composer require myopensoft/laravel-kepoh-telegram

You can publish the config file with:

php artisan vendor:publish --provider="Myopensoft\KepohTelegram\KepohTelegramServiceProvider" --tag="kepoh-telegram-config"

This is the contents of the published config file:

return [
    'telegram' => [
        'enable' => env('KEPOH_TELEGRAM_ENABLE', false),
        'bot_token' => env('KEPOH_TELEGRAM_BOT_TOKEN'),
        'chat_id' => env('KEPOH_TELEGRAM_CHAT_ID'),
        'dont_report' => [
            \Illuminate\Auth\AuthenticationException::class,
            \Illuminate\Auth\Access\AuthorizationException::class,
            \Illuminate\Session\TokenMismatchException::class,
            \Illuminate\Validation\ValidationException::class,
        ]
    ]
];

Usage

Put into Handler.php

public function report(Throwable $exception)
{
    // ...
    
    KepohTelegram::report($exception);

    parent::report($exception);
}

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

License

The MIT License (MIT). Please see License File for more information.