Repolode
laravel-notification-channels

laravel-notification-channels/telegram

Laravel package that adds a Telegram channel so notifications can be sent through the Telegram Bot API.

Stars
1,119
Forks
174
Open issues
0
Last commit
2 months ago

What is it?

This package lets Laravel applications send notifications to Telegram users, groups, and channels through the Telegram Bot API. You return the channel from a notification's via() method and build the message with a fluent TelegramMessage, TelegramFile, TelegramPoll, or similar class.

Beyond plain text, it supports keyboards and inline buttons, photos, documents, audio, video, stickers, locations, venues, contacts, dice, polls, and media groups. Files can be passed as URLs, local paths, Telegram file IDs, or raw contents. It also includes a TelegramUpdates helper to look up chat IDs, a routing hook on notifiable models, and error handling through a NotificationFailed event or an onError callback. Requests can go through a proxy or a self-hosted Bot API server.

Key features

  • 01Fluent builders for text, files, polls, dice, locations, contacts and media groups
  • 02Inline buttons, reply keyboards and Markdown/HTML formatting
  • 03Local, remote, file ID and raw-content attachments
  • 04Helper to fetch updates and find chat IDs
  • 05Failure handling via NotificationFailed event or onError callback
  • 06Proxy and self-hosted Bot API server support

Use cases

  • Sending order or invoice alerts from a Laravel app to a customer's Telegram account
  • Posting server or monitoring alerts into a team Telegram group
  • Running polls or quizzes from application events
  • Broadcasting announcements to many subscribers while respecting Telegram rate limits

Quick start

  1. 1

    Install the package with Composer

    composer require laravel-notification-channels/telegram
  2. 2

    Create a bot with @BotFather and set TELEGRAM_BOT_TOKEN in config/services.php

  3. 3

    Return 'telegram' from a notification's via() method and define toTelegram()

Things to know

  • Requires a Telegram bot token and a chat ID, and users must message the bot first.

Topics

#laravel#php#telegram#telegram-bot#notifications#bot-api#hacktoberfest#laravel-13#laravel-notification-channels#laravel-notifications

FAQ

What is telegram?
Laravel package that adds a Telegram channel so notifications can be sent through the Telegram Bot API. This package lets Laravel applications send notifications to Telegram users, groups, and channels through the Telegram Bot API. You return the channel from a notification's via() method and build the message with a fluent TelegramMessage, TelegramFile, TelegramPoll, or similar class.
Is telegram free to use? What license does it have?
telegram is open source under the MIT license. Check the license terms before using it in commercial products.
Is telegram still maintained?
Updated within 6 months. The last commit to telegram was on Sep 4, 2026.
What can I use telegram for?
Sending order or invoice alerts from a Laravel app to a customer's Telegram account Posting server or monitoring alerts into a team Telegram group Running polls or quizzes from application events Broadcasting announcements to many subscribers while respecting Telegram rate limits
How do I install telegram?
Install the package with Composer: composer require laravel-notification-channels/telegram Create a bot with @BotFather and set TELEGRAM_BOT_TOKEN in config/services.php Return 'telegram' from a notification's via() method and define toTelegram()
Where can I get telegram?
The source code and installation instructions are on GitHub: https://github.com/laravel-notification-channels/telegram

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects