Laravel: Create Telegram Bot Application without Botman Studio


We are using Botman package, and Botman Telegram Driver.

Configure .env

Use Bot Father to create new bot and get the API Token for the bot, store it in .env.


Telegram End Point

Create a route & controller for your Telegram Bot to use after this (webhook).

In TelegramController, add the following:

Now you are done preparing for next part.


For development purpose, you can use valet share to have a live server. For Windows / Linux, you can install to have a live server.

valet share is actually running a ngrok.

Run command valet share and and then register our app with Telegram using php artisan botman:telegram:register command.

CSRF Token

In AppHttpMiddlewareVerifyCsrfToken, disable CSRF token for /telegram route.

One you are done setting up the webhook, open up your Telegram, start talk with your bot, /hi. You should received response from your bot.

5 thoughts on “Laravel: Create Telegram Bot Application without Botman Studio

Leave a Reply

Your email address will not be published. Required fields are marked *

3 × 4 =