New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

westacks/telebot-laravel

Telebot adapter for Laravel
36,859 15
Install
composer require westacks/telebot-laravel
Latest Version:4.6.2
PHP:^8.2
Laravel:9 – 13
Older releases:5 – 8
License:MIT
Last Updated:Aug 25, 2026
Links: GitHub  ·  Packagist
Maintainer: PunyFlash

Stand With Ukraine

Project Logo

Latest Stable Version Total Downloads License Pest

TeleBot is a PHP library for telegram bots development. This project is a Laravel adapter for TeleBot

Installation

Install the package with composer:

composer require westacks/telebot-laravel

Complete setup with the following command:

php artisan telebot:install

Farther steps

Documentation for the library can be found on the website.

Features

Laravel Support

Library provides a Facade, artisan commands and notification channel to simplify the development process of your bot, if you are using Laravel:

Laravel Boost Skill

This package ships with a Laravel Boost skill. Install it via:

php artisan boost:add-skill westacks/telebot-laravel
Facade
TeleBot::getMe();
TeleBot::bot('bot2')->getMe();
Creating update handlers

You can create different types of update handlers or bot kernel with the following command:

$ php artisan make:telebot:kernel
$ php artisan make:telebot:update-handler
$ php artisan make:telebot:command-handler
$ php artisan make:telebot:callback-handler
$ php artisan make:telebot:input-handler
Automatic webhook generation

After you insert your bot token, to create a webhook you need only to fire the following command:

$ php artisan telebot:webhook --setup

Route for handling updates is generated automatically for your APP_URL

Long polling

If you are not using webhook, or want to use bot in local or test environment, you may start long polling by only firyng this command:

$ php artisan telebot:polling
Setup commands autocompletion

The following command will automatically setup autocompletion for all registered bot commands on Telegram servers:

$ php artisan telebot:commands --setup
Notification channel
<?php

namespace App\Notifications;

use Illuminate\Notifications\Notification;
use WeStacks\TeleBot\Laravel\TelegramNotification;

class TelegramNotification extends Notification
{
    public function via($notifiable)
    {
        return ['telegram'];
    }

    public function toTelegram($notifiable)
    {
        return (new TelegramNotification)->bot('bot')
            ->sendMessage([
                'chat_id' => $notifiable->telegram_chat_id,
                'text'    => 'Hello, from Laravel\'s notifications!'
            ])
            ->sendMessage([
                'chat_id' => $notifiable->telegram_chat_id,
                'text'    => 'Second message'
            ]);
    }
}
Log driver

You may log your application errors by sending them to some Telegram chat. Simply add new log driver to a config/logging.php:

'telegram' => [
    'driver'    => 'custom',
    'via'       => \WeStacks\TeleBot\Laravel\Log\TelegramLogger::class,
    'level'     => 'debug',
    'bot'       => 'bot',
    'chat_id'   => env('TELEGRAM_LOG_CHAT_ID') // Any chat where bot can write messages.
]

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Credits

License

The MIT License (MIT). Please see License File for more information.

Related Packages

doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

648,266,899 9,701
laravel/framework

The Laravel Framework.

604,216,237 34,982
laravel/tinker

Powerful REPL for the Laravel framework.

512,508,631 7,443
laravel/serializable-closure

Laravel Serializable Closure provides an easy and secure way to serialize closur...

429,221,767 607
nunomaduro/collision

Cli error handling for console/command-line PHP applications.

407,699,310 4,663

Version History

Version Released PHP Laravel License
4.6.2 ^8.2 ^9.0 || ^10.0 || ^11.0 || ^12.0 || ^13.0 MIT
4.6.1 ^8.2 ^9.0 || ^10.0 || ^11.0 || ^12.0 || ^13.0 MIT
4.6.0 ^8.2 ^9.0 || ^10.0 || ^11.0 || ^12.0 || ^13.0 MIT
4.5.1 ^8.2 ^9.0 || ^10.0 || ^11.0 || ^12.0 || ^13.0 MIT
4.5.0 ^8.2 ^9.0 || ^10.0 || ^11.0 || ^12.0 || ^13.0 MIT
Pre-releases (2)
Version Released PHP Laravel License
4.0.0-alpha.1 ^8.2 ^9.0 || ^10.0 || ^11.0 || ^12.0 MIT
4.0.0-alpha.0 ^8.0 ^5.5 || ^6.0 || ^7.0 || ^8.0 || ^9.0 || ^10.0 || ^11.0 || ^12.0 MIT