Package for laravel TLE - Telegram logger errors
Run composer require command.
composer require jackmartin/telegram-logger-errors
After updating composer, register the service provider in boostrap\app.php
Telegram\Bot\Laravel\TelegramServiceProvider::class,
TLE\TLEServiceProvider::class
Add 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::class
php artisan vendor:publish
Select Provider: Telegram\Bot\Laravel\TelegramServiceProvider
php artisan vendor:publish
Select 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' => false
Need 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::class
php 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);
}