PHPackages                             maxbond/telegram-custom-url - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Mail &amp; Notifications](/categories/mail)
4. /
5. maxbond/telegram-custom-url

ActiveLibrary[Mail &amp; Notifications](/categories/mail)

maxbond/telegram-custom-url
===========================

Telegram Notifications Driver

v1.2(7y ago)018MITPHPPHP &gt;=5.6.4

Since Aug 13Pushed 7y ago1 watchersCompare

[ Source](https://github.com/maxbond/telegram)[ Packagist](https://packagist.org/packages/maxbond/telegram-custom-url)[ Docs](https://github.com/laravel-notification-channels/telegram)[ RSS](/packages/maxbond-telegram-custom-url/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (6)Versions (9)Used By (0)

Telegram Notifications Channel for Laravel 5.3 \[WIP\]
======================================================

[](#telegram-notifications-channel-for-laravel-53-wip)

[![Latest Version on Packagist](https://camo.githubusercontent.com/afb682b1bb332a5f8fa641ef9470ba991732060c4d2af1c8d7a7b6f13fe96108/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c61726176656c2d6e6f74696669636174696f6e2d6368616e6e656c732f74656c656772616d2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/laravel-notification-channels/telegram)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/d1d9afb56e733c2071d4f9cc8b329e6e2ebf767ff396accb399ca383bf49f826/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6c61726176656c2d6e6f74696669636174696f6e2d6368616e6e656c732f74656c656772616d2f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/laravel-notification-channels/telegram)[![StyleCI](https://camo.githubusercontent.com/356c3f0c2897326fc7072509a3351ae58ea23cb76056cec777f70029a7e8d83e/68747470733a2f2f7374796c6563692e696f2f7265706f732f36353439303733352f736869656c64)](https://styleci.io/repos/65490735)[![SensioLabsInsight](https://camo.githubusercontent.com/23166fdd159a0b9a2ebc0539e7723149c5123ed87a0b25dc08b75031fb46b4c9/68747470733a2f2f696d672e736869656c64732e696f2f73656e73696f6c6162732f692f64323865333165632d353563652d343330362d383861332d3834643564313461643364622e7376673f7374796c653d666c61742d737175617265)](https://insight.sensiolabs.com/projects/d28e31ec-55ce-4306-88a3-84d5d14ad3db)[![Quality Score](https://camo.githubusercontent.com/9c21bb2ff37ed2c840ce948efccdc5ddae4916c0d695c1eb8069e740a846289c/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f6c61726176656c2d6e6f74696669636174696f6e2d6368616e6e656c732f74656c656772616d2e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/laravel-notification-channels/telegram)[![Code Coverage](https://camo.githubusercontent.com/223f0c5b6ba6b8a6c07606c6c7a6f7e1123086b8b7e0808e1d4488244a91fa34/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f6c61726176656c2d6e6f74696669636174696f6e2d6368616e6e656c732f74656c656772616d2f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/laravel-notification-channels/telegram/?branch=master)[![Total Downloads](https://camo.githubusercontent.com/cbf836d6ed29bc57b269b1a05bacb58bb063229dc58c777b42269ab8f29c1653/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c61726176656c2d6e6f74696669636174696f6e2d6368616e6e656c732f74656c656772616d2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/laravel-notification-channels/telegram)

This package makes it easy to send Telegram notification using [Telegram Bot API](https://core.telegram.org/bots) with Laravel 5.3.

Contents
--------

[](#contents)

- [Installation](#installation)
    - [Setting up your Telegram bot](#setting-up-your-telegram-bot)
- [Usage](#usage)
    - [Available Message methods](#available-message-methods)
- [Alternatives](#alternatives)
- [Changelog](#changelog)
- [Testing](#testing)
- [Security](#security)
- [Contributing](#contributing)
- [Credits](#credits)
- [License](#license)

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require laravel-notification-channels/telegram
```

You must install the service provider:

```
// config/app.php
'providers' => [
    ...
    NotificationChannels\Telegram\TelegramServiceProvider::class,
],
```

Setting up your Telegram Bot
----------------------------

[](#setting-up-your-telegram-bot)

Talk to [@BotFather](https://core.telegram.org/bots#6-botfather) and generate a Bot API Token.

Then, configure your Telegram Bot API Token:

```
// config/services.php
...
'telegram-bot-api' => [
    'token' => env('TELEGRAM_BOT_TOKEN', 'YOUR BOT TOKEN HERE')
],
...
```

Usage
-----

[](#usage)

You can now use the channel in your `via()` method inside the Notification class.

```
use NotificationChannels\Telegram\TelegramChannel;
use NotificationChannels\Telegram\TelegramMessage;
use Illuminate\Notifications\Notification;

class InvoicePaid extends Notification
{
    public function via($notifiable)
    {
        return [TelegramChannel::class];
    }

    public function toTelegram($notifiable)
    {
        $url = url('/invoice/' . $this->invoice->id);

        return TelegramMessage::create()
            ->to($this->user->telegram_user_id) // Optional.
            ->content("*HELLO!* \n One of your invoices has been paid!") // Markdown supported.
            ->button('View Invoice', $url); // Inline Button
    }
}
```

Here's a screenshot preview of the above notification on Telegram Messenger:

[![Laravel Telegram Notification Example](https://cloud.githubusercontent.com/assets/1915268/17590374/2e05e872-5ff7-11e6-992f-63d5f3df2db3.png)](https://cloud.githubusercontent.com/assets/1915268/17590374/2e05e872-5ff7-11e6-992f-63d5f3df2db3.png)

### Attach a Photo

[](#attach-a-photo)

```
...
    public function toTelegram($notifiable)
    {
        $url = url('/file/' . $this->file->id);

        return TelegramMessage::create()
            ->to($this->user->telegram_user_id) // Optional.
            ->content("*bold text* [inline URL](http://www.example.com/)") // Markdown supported.
            ->file('/storage/archive/6029014.jpg', 'photo') // local photo
            // OR
            // ->file('https://pisces.bbystatic.com/image2/BestBuy_US/images/products/6029/6029014_rd.jpg', 'photo') // remote photo
            ->button('Download PDF', $url); // Inline Button
    }
...
```

Sample : [![photo5879686121305255739](https://user-images.githubusercontent.com/785830/46316802-ff82b300-c5dd-11e8-85c9-58c66ad29895.jpg)](https://user-images.githubusercontent.com/785830/46316802-ff82b300-c5dd-11e8-85c9-58c66ad29895.jpg)

### Attach a Document

[](#attach-a-document)

```
...
    public function toTelegram($notifiable)
    {
        $url = url('/file/' . $this->file->id);

        return TelegramMessage::create()
            ->to($this->user->telegram_user_id) // Optional.
            ->content("*bold text* [inline URL](http://www.example.com/)") // Markdown supported.
            ->file('/storage/archive/file.pdf', 'document') // local file
            // OR
            // ->file('http://www.domain.com/file.pdf', 'document') // remote file
            ->button('Download PDF', $url); // Inline Button
    }
...
```

Sample : [![photo5879686121305255737](https://user-images.githubusercontent.com/785830/46316801-feea1c80-c5dd-11e8-99c2-21d00b165a66.jpg)](https://user-images.githubusercontent.com/785830/46316801-feea1c80-c5dd-11e8-99c2-21d00b165a66.jpg)

### Routing a message

[](#routing-a-message)

You can either send the notification by providing with the chat id of the recipient to the `to($chatId)` method like shown in the above example or add a `routeNotificationForTelegram()` method in your notifiable model:

```
...
/**
 * Route notifications for the Telegram channel.
 *
 * @return int
 */
public function routeNotificationForTelegram()
{
    return $this->telegram_user_id;
}
...
```

### Available Message methods

[](#available-message-methods)

- `to($chatId)`: (integer) Recipient's chat id.
- `content('')`: (string) Notification message, supports markdown. For more information on supported markdown styles, check out these [docs](https://telegram-bot-sdk.readme.io/docs/sendmessage#section-markdown-style).
- `button($text, $url)`: (string) Adds an inline "Call to Action" button. You can add as many as you want and they'll be placed 2 in a row.
- `options([])`: (array) Allows you to add additional or override `sendMessage` payload (A Telegram Bot API method used to send message internally). For more information on supported parameters, check out these [docs](https://telegram-bot-sdk.readme.io/docs/sendmessage).

Alternatives
------------

[](#alternatives)

For advance usage, please consider using [telegram-bot-sdk](https://github.com/irazasyed/telegram-bot-sdk) instead.

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Testing
-------

[](#testing)

```
$ composer test
```

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Credits
-------

[](#credits)

- [Syed Irfaq R.](https://github.com/irazasyed)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~138 days

Recently: every ~106 days

Total

8

Last Release

2586d ago

Major Versions

0.0.5 → v1.02019-04-11

### Community

Maintainers

![](https://www.gravatar.com/avatar/3931bde922424314842a752c2fbb4c9f569245596ab4ef7de9ba86793080fb60?d=identicon)[maxbond](/maintainers/maxbond)

---

Top Contributors

[![irazasyed](https://avatars.githubusercontent.com/u/1915268?v=4)](https://github.com/irazasyed "irazasyed (34 commits)")[![freekmurze](https://avatars.githubusercontent.com/u/483853?v=4)](https://github.com/freekmurze "freekmurze (18 commits)")[![maxbond](https://avatars.githubusercontent.com/u/426899?v=4)](https://github.com/maxbond "maxbond (6 commits)")[![irajtaghlidi](https://avatars.githubusercontent.com/u/785830?v=4)](https://github.com/irajtaghlidi "irajtaghlidi (3 commits)")[![bmitch](https://avatars.githubusercontent.com/u/4009957?v=4)](https://github.com/bmitch "bmitch (2 commits)")[![themsaid](https://avatars.githubusercontent.com/u/4332182?v=4)](https://github.com/themsaid "themsaid (2 commits)")[![Lotuashvili](https://avatars.githubusercontent.com/u/6238393?v=4)](https://github.com/Lotuashvili "Lotuashvili (1 commits)")[![mpociot](https://avatars.githubusercontent.com/u/804684?v=4)](https://github.com/mpociot "mpociot (1 commits)")[![okaufmann](https://avatars.githubusercontent.com/u/4414498?v=4)](https://github.com/okaufmann "okaufmann (1 commits)")[![oyed](https://avatars.githubusercontent.com/u/172114265?v=4)](https://github.com/oyed "oyed (1 commits)")[![peregraum](https://avatars.githubusercontent.com/u/6589559?v=4)](https://github.com/peregraum "peregraum (1 commits)")[![jackcolley](https://avatars.githubusercontent.com/u/10242327?v=4)](https://github.com/jackcolley "jackcolley (1 commits)")[![casperboone](https://avatars.githubusercontent.com/u/15815208?v=4)](https://github.com/casperboone "casperboone (1 commits)")[![enniel](https://avatars.githubusercontent.com/u/19760944?v=4)](https://github.com/enniel "enniel (1 commits)")[![ivanvermeyen](https://avatars.githubusercontent.com/u/3598622?v=4)](https://github.com/ivanvermeyen "ivanvermeyen (1 commits)")[![belguinan](https://avatars.githubusercontent.com/u/19215568?v=4)](https://github.com/belguinan "belguinan (1 commits)")[![JayBizzle](https://avatars.githubusercontent.com/u/340752?v=4)](https://github.com/JayBizzle "JayBizzle (1 commits)")

---

Tags

laravelnotificationtelegramtelegram notificationtelegram notifications channel

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/maxbond-telegram-custom-url/health.svg)

```
[![Health](https://phpackages.com/badges/maxbond-telegram-custom-url/health.svg)](https://phpackages.com/packages/maxbond-telegram-custom-url)
```

###  Alternatives

[laravel-notification-channels/telegram

Telegram Notifications Channel for Laravel

1.1k3.4M35](/packages/laravel-notification-channels-telegram)[laravel-notification-channels/discord

Laravel notification driver for Discord.

2371.3M11](/packages/laravel-notification-channels-discord)[s-ichikawa/laravel-sendgrid-driver

This library adds a 'sendgrid' mail driver to Laravel.

4139.3M1](/packages/s-ichikawa-laravel-sendgrid-driver)[laravel-notification-channels/twilio

Provides Twilio notification channel for Laravel

2587.7M12](/packages/laravel-notification-channels-twilio)[gr8shivam/laravel-sms-api

A modern, flexible Laravel package for integrating any SMS gateway with REST API support

10138.4k](/packages/gr8shivam-laravel-sms-api)[ghanem/laravel-smsmisr

Send SMS and SMS Notification via SMS Misr for Laravel

194.8k](/packages/ghanem-laravel-smsmisr)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
