php-telegram-bot / laravel

Laravel package for PHP Telegram Bot Library
Other
171 stars 51 forks source link

How to use this version? #59

Closed dimondubna closed 6 months ago

dimondubna commented 6 months ago

Hello, i have a fresh setup of laravel 10 and php-telegram-bot/laravel

In .env i provided api_key and username.

In web.php i tried to use this:

use PhpTelegramBot\Laravel\PhpTelegramBotContract; Route::post('/webhook', function (PhpTelegramBotContract $telegramBot) { return $telegramBot->handle(); });

But i have an error.

ReflectionException: Class "PhpTelegramBot\Laravel\PhpTelegramBotContract" does not exist in file D:\OpenServer\domains\aml-bot\vendor\laravel\framework\src\Illuminate\Routing\ResolvesRouteDependencies.php on line 81

In previous version (laravel 9 and php-telegram-bot/laravel v 2.0.3) i don`t have such errors. Please, help me.