Fluently interaction with Telegram Bots in Laravel
Not a long time ago (Feb. 25th), Fabio Ivona announced the release of a package called "Telegraph" whis is "a Laravel package for fluently interaction with Telegram Bots". The package looks really interesting because it simplifies the process of working with Telegram's API.
It's as easy as:
Telegraph::message('hello')->send();
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>Just relased a new @laravelphp package:
— Fabio Ivona (@FabioIvona) February 25, 2022
👉https://t.co/G7Kxe2CaWr👈
Telegraph, a fluent tool to handle @telegram Bots as easy as:
Telegraph::message('hello')->send()
it supports sending messages, button keyboards, command and callback query handling, and much more! pic.twitter.com/pBUYgBndvP
Registering a bot with Telegraph
The process of creating a new both is pretty straightforward. The package supports two ways:
Running an artisan command:
php artisan telegraph:new-bot
After running this command, you'll be directed through a bot creation process, which will allow you to establish a new conversation and set up a bot webhook.

The second way in wich you can create a new bot is by using the TelegraphBot model to generate the new bot and that's useful if you're implementing custom logic:
$bot = TelegraphBot::create([
'token' => $token,
'name' => $name,
]);
I'm planing to create a Telegram channel for Laravel Magazine and I will play with this package more and I intend to maybe come up with either a video or a tutorial how to work with Telegraph in a Laravel application.
I reccomend checking out Telegraph's documentation and the Github Repo for more useful informations and an installation guide.