A plug-and-play Laravel package that adds a real-time Telegram-powered support inbox, a customer chat widget, and a Telegram account connect component — all in three Blade tags.
Drop one Blade tag into your view and get a fully working, styled, multilingual UI component — no JavaScript configuration needed.
A full admin-facing SPA chat interface. See all Telegram conversations in a sidebar, click a chat to open the room, and reply in real time — just like Telegram Web.
Open live demo →A floating bubble your site visitors use to reach your Telegram support. Animates in, supports a custom title and brand color, and works on any page in seconds.
Open live demo →
Embed inside any registration or profile form. Generates a one-time token, guides the user
to message your bot, and injects a hidden input with the resulting chat_id — your controller handles the rest.
Designed to be dropped into any existing Laravel app without friction.
Add your bot token to .env and you're live. No extra service registration.
Ships with English & Arabic out of the box. Publish lang files to add any locale.
Color, title, height — every component accepts props. Publish views to go further.
Set your guard name in config (web or api) — the package adapts.
Laravel auto-discovery registers the service provider and Blade components automatically.
No build step for consumers. Assets ship ready-to-publish in dist/.
Chats, messages, and connect tokens — all with safe up() / down() migrations.
Run telegram:test to verify your bot token and webhook connectivity instantly.
Before using this package you need a bot token. BotFather is the official Telegram bot that creates and manages all other bots — the whole process takes under 2 minutes.
BotFather is Telegram's official bot for creating and managing bots. Open it directly at t.me/BotFather and follow the steps below.
Search for @BotFather in Telegram or visit t.me/BotFather. Tap Start to begin.
/newbot — create a new bot/mybots — manage your bots
Type and send /newbot to start the bot creation wizard.
/newbot
Send any name you like — this is the display name users will see in chats.
bot — e.g. mysupportbot or MySupportBot.
bot)Send your desired username. It must be unique across all of Telegram and end with bot.
7796489946:AAH8zgmjTDMh7NBdLJ0VeP...1234567890:AABBccDDee.... Copy it — you'll need it next..envOpen your Laravel project's .env file and set the following variables:
TELEGRAM_BOT_TOKEN=7796489946:AAH8zgmjTDMh7NBdLJ0VeP... TELEGRAM_BOT_USERNAME=MySupportBot # without the @ TELEGRAM_GUARD=web # or api
php artisan telegram:test after setup — it calls the Telegram API and confirms your token is valid.Four steps from zero to a working support inbox.
Install via Composer. Laravel auto-discovers the service provider.
$ composer require mu7mdmagdy/laravel-telegram-support
# Publish everything at once $ php artisan vendor:publish --provider="MoMagdy\TelegramSupport\TelegramSupportServiceProvider" # Or publish individually $ php artisan vendor:publish --tag=telegram-config $ php artisan vendor:publish --tag=telegram-assets $ php artisan vendor:publish --tag=telegram-migrations $ php artisan migrate
TELEGRAM_BOT_TOKEN=7796489946:AAH8zgmj... TELEGRAM_BOT_USERNAME=YourBotName TELEGRAM_GUARD=web # or api
<!-- Admin inbox --> <x-telegram-support height="100vh" /> <!-- Customer widget --> <x-telegram-widget title="Support Chat" color="#1e88e5" /> <!-- In a registration form --> <x-telegram-connect label="Connect Telegram" :required="true" />
All props, their types, and defaults at a glance.
<!-- The component injects a hidden input into the parent <form> --> <!-- Your controller reads it like any other form field: --> <form method="POST" action="/register"> <!-- your other fields ... --> <x-telegram-connect label="Connect Telegram Account" color="#1e88e5" :required="true" /> <!-- ↑ injects: <input type="hidden" name="telegram_chat_id" value="..."> --> <button type="submit">Register</button> </form> <!-- Controller --> $chatId = $request->input('telegram_chat_id'); $user->update(['telegram_chat_id' => $chatId]);
// app/Models/User.php use MoMagdy\TelegramSupport\Traits\HasTelegramNotifications; class User extends Authenticatable { use HasTelegramNotifications; // telegram_chat_id must be in $fillable protected $fillable = ['name', 'email', 'telegram_chat_id', ...]; } // Send a message to this user's Telegram: $user->sendTelegram('Your order has shipped! 🚀');
return [ 'bot_token' => env('TELEGRAM_BOT_TOKEN'), 'bot_username' => env('TELEGRAM_BOT_USERNAME'), 'guard' => env('TELEGRAM_GUARD', 'api'), // auth guard for inbox routes 'chat_id_column' => 'telegram_chat_id', // hidden input name ];
Star the repo, report issues, or contribute a PR — the package is open source and welcoming contributions.