diff --git a/README.md b/README.md index 0009c3e..4b305ca 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ Or you can simply change the default log channel in the .env LOG_CHANNEL=telegram ``` -Publish config file +Publish config file and views ``` php artisan vendor:publish --provider "Logger\TelegramLoggerServiceProvider" ``` @@ -71,6 +71,14 @@ For using this package you need to create Telegram bot 4. Get token and add it to your .env file (it is written above) 5. Go to your bot and send ``/start`` message +## Change log template at runtime + +1. Change config for template. +```php +config(['telegram-logger.template'=>'laravel-telegram-logging::custom']) +``` +2. Use `Log` as usual. + ## Lumen support To make it work with Lumen, you need also run two steps: diff --git a/src/TelegramLoggerServiceProvider.php b/src/TelegramLoggerServiceProvider.php index 5f0ea28..222dd46 100644 --- a/src/TelegramLoggerServiceProvider.php +++ b/src/TelegramLoggerServiceProvider.php @@ -28,7 +28,7 @@ public function register() public function boot() { $this->loadViewsFrom(__DIR__.'/views', 'laravel-telegram-logging'); - $this->publishes([__DIR__.'/views' => base_path('resources/views/vendor/laravel-telegram-logging')],'views' ); + $this->publishes([__DIR__.'/views' => base_path('resources/views/vendor/laravel-telegram-logging')], 'views'); $this->publishes([__DIR__ . '/../config/telegram-logger.php' => config_path('telegram-logger.php')], 'config'); } }