Package for laravel TLE - Telegram logger errors
Run composer require command.
composer require jackmartin/telegram-logger-errorsAfter updating composer, register the service provider in boostrap\app.php
Telegram\Bot\Laravel\TelegramServiceProvider::class,
TLE\TLEServiceProvider::classAdd then alias TLE adding its facade to the aliases array in the same file:
'Telegram' => Telegram\Bot\Laravel\Facades\Telegram::class,
'TLE' => TLE\Facades\TLEFacade::classphp artisan vendor:publishSelect Provider: Telegram\Bot\Laravel\TelegramServiceProvider
php artisan vendor:publishSelect Tag: tle-config
or
php artisan vendor:publish --provider="TLE\TLEServiceProvider" --tag="tle-config"'bots' => [
'common' => [
'username' => 'Name bot',
'token' => 'Token bot',
'commands' => [],
],
],
'default' => 'common','debug' => falseNeed for Telegram SDK
'botname' => ''Chat ID you can get via chat bot @RawDataBot
'chat_id' => '''save_log' => true'path_save' => 'local'use TLE;
try {
print_r($a);
} catch (\Exception $e) {
TLE::exp($e)->send();
}use TLE;
try {
print_r($a);
} catch (\Exception $e) {
TLE::exp($e)->info('Field check')->send();
}use TLE;
try {
print_r($a);
} catch (RequestException $e) {
TLE::guzzle($e)->send();
}public function report(Exception $exception)
{
\TLE::exp($exception)->send();
parent::report($exception);
}Пакет для laravel TLE - Telegram логгер ошибок
Установить пакет с помощью composer
composer require jackmartin/telegram-logger-errorsПосле установки пакета с помощью composer, зарегистрируйте сервис пакета в файле bootstrap/app.php:
Telegram\Bot\Laravel\TelegramServiceProvider::class,
TLE\TLEServiceProvider::classЗатем для быстрого вызов класса пакета, добавьте псевдоним в этот же файле:
'Telegram' => Telegram\Bot\Laravel\Facades\Telegram::class,
'TLE' => TLE\Facades\TLEFacade::classphp artisan vendor:publishВыбираем Provider: Telegram\Bot\Laravel\TelegramServiceProvider
php artisan vendor:publishВыбираем Tag: tle-config
или
php artisan vendor:publish --provider="TLE\TLEServiceProvider" --tag="tle-config"'bots' => [
'common' => [
'username' => 'Name bot',
'token' => 'Token bot',
'commands' => [],
],
],
'default' => 'common','debug' => falseНужно для Telegram SDK
'botname' => '''chat_id' => '''save_log' => true'path_save' => 'local'use TLE;
try {
print_r($a);
} catch (\Exception $e) {
TLE::exp($e)->send();
}use TLE;
try {
print_r($a);
} catch (\Exception $e) {
TLE::exp($e)->info('Field check')->send();
}use TLE;
try {
print_r($a);
} catch (RequestException $e) {
TLE::guzzle($e)->send();
}public function report(Exception $exception)
{
\TLE::exp($exception)->send();
parent::report($exception);
}