1
- # Telegram Bot Package for Laravel 5 .x
1
+ # Telegram Bot Package for Laravel 6 .x
2
2
3
3
[ ![ Build Status] ( https://travis-ci.org/php-telegram-bot/laravel.svg?branch=master )] ( https://travis-ci.org/php-telegram-bot/laravel )
4
4
[ ![ Code Coverage] ( https://img.shields.io/scrutinizer/coverage/g/php-telegram-bot/laravel/master.svg?style=flat-square )] ( https://scrutinizer-ci.com/g/php-telegram-bot/laravel/?b=master )
@@ -42,18 +42,10 @@ And run composer update
42
42
43
43
composer require php-telegram-bot/laravel
44
44
45
- In Laravel 5.5 the service provider will automatically get registered.
46
- In older versions of the framework just add the service provider in ` config/app.php ` file:
47
-
48
- ``` php
49
- PhpTelegramBot\Laravel\PhpTelegramBotServiceProvider::class,
50
- ```
51
-
52
45
Copy the package config and migrations to your project with the publish command:
53
46
54
47
php artisan vendor:publish --provider="PhpTelegramBot\Laravel\PhpTelegramBotServiceProvider"
55
48
56
-
57
49
After run migration command
58
50
59
51
php artisan migrate
@@ -74,16 +66,17 @@ use PhpTelegramBot\Laravel\PhpTelegramBotContract;
74
66
75
67
class CustomController extends Controller
76
68
{
77
- public function handle(PhpTelegramBotContract $telegram_bot )
69
+ public function handle(PhpTelegramBotContract $telegramBot )
78
70
{
79
71
// Call handle method
80
- $telegram_bot ->handle();
72
+ $telegramBot ->handle();
81
73
82
74
// Or set webhook
83
- $telegram_bot->setWebhook($hook_url);
75
+ $hookUrl = 'https://hook.url';
76
+ $telegramBot->setWebhook($hookUrl);
84
77
85
78
// Or handle telegram getUpdates request
86
- $telegram_bot ->handleGetUpdates();
79
+ $telegramBot ->handleGetUpdates();
87
80
}
88
81
}
89
82
0 commit comments