TelegramBot / Api

Native PHP Wrapper for Telegram BOT API
MIT License
1.08k stars 323 forks source link

how use in laravel #133

Closed pooriajahedi closed 4 years ago

pooriajahedi commented 6 years ago

Hi sir @YaroslavMolchan How can i use this package for laravel and set webhook ?

TheMY3 commented 6 years ago

The same as for others frameworks, and need to remove csrf for route with telegram webhook

pooriajahedi commented 6 years ago

this is my controller image and this is my route : Route::post('/api/telegram', 'robot\RobotController@webhook');

pooriajahedi commented 6 years ago

Is this true ?

TheMY3 commented 6 years ago

Need to add api/telegram to except for csrf

pooriajahedi commented 6 years ago

i added this rout to exception. and {TelegramBot\Api\Client} return this object. image

bot not return $this->bot;

pooriajahedi commented 6 years ago

@YaroslavMolchan please help me.

TheMY3 commented 6 years ago

@pooria-jahedi I don't understand your code, what is it - $bot = $this->bot? Just get code from readme and it will work.