PHPackages                             alimousavi/telenotify - 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. alimousavi/telenotify

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

alimousavi/telenotify
=====================

A Laravel package for sending notifications via Telegram.

v1.0.0(1y ago)0143—0%MITPHPPHP &gt;=8.0

Since Jun 28Pushed 1y ago1 watchersCompare

[ Source](https://github.com/alimousavidev/telenotify)[ Packagist](https://packagist.org/packages/alimousavi/telenotify)[ Docs](https://github.com/alimousavidev/telenotify)[ RSS](/packages/alimousavi-telenotify/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

TeleNotify
==========

[](#telenotify)

TeleNotify is a Laravel notification channel for sending messages via Telegram bots.

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

[](#installation)

You can install the package via composer:

```
composer require alimousavi/telenotify
```

Optionally, you can publish the configuration file:

```
php artisan vendor:publish --provider="AliMousavi\TeleNotify\TeleNotifyServiceProvider"
```

This will publish a configuration file named `telenotify.php` where you can set your Telegram bot API token.

Usage
-----

[](#usage)

### Step 1: Add Telegram Bot Token

[](#step-1-add-telegram-bot-token)

Add your Telegram bot token to your `.env` file:

```
TELEGRAM_BOT_API_TOKEN=your-bot-api-token
```

### Step 2: Implement TeleNotifiable Interface

[](#step-2-implement-telenotifiable-interface)

Your notifiable model (e.g., User, Employee) should implement the `TeleNotifiable` interface and provide a method `getTelegramChatId()`:

```
use Alimousavi\TeleNotify\Contracts\TeleNotifiableInterface;

class User implements TeleNotifiableInterface
{
    // ...

    public function getTelegramChatId(): string|int|null
    {
        return $this->telegram_chat_id;
    }
}
```

### Note: Using TeleNotifiable Trait

[](#note-using-telenotifiable-trait)

If your notifiable model already has a `telegram_chat_id` property, you can simplify implementation by using the `TeleNotifiable` trait:

```
use Alimousavi\TeleNotify\Contracts\TeleNotifiableInterface;
use Alimousavi\TeleNotify\Traits\TeleNotifiable;

class User implements TeleNotifiableInterface
{
    use TeleNotifiable;

    // ...
}
```

Using the trait is optional but recommended if your notifiable model includes the `telegram_chat_id` property to adhere to the `TeleNotifiableInterface` requirements.

### Step 3: Use TelegramChannel in Notifications

[](#step-3-use-telegramchannel-in-notifications)

In your notification class, use the `TelegramChannel::class` in the `via()` method and implement `toTelegram()` method:

```
use Illuminate\Notifications\Notification;
use Alimousavi\TeleNotify\Channels\TelegramChannel;
use Alimousavi\TeleNotify\Contracts\TeleNotifiable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Bus\Queueable;

class ExampleNotification extends Notification implements ShouldQueue
{
    use Queueable;

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

    public function toTelegram(TeleNotifiable $notifiable)
    {
        return [
            'text' => 'Hello, this is a test message from TeleNotify!',
        ];
    }
}
```

I highly recommend implementing `ShouldQueue` and using the `Queueable` trait to optimize performance and enhance the responsiveness of your notification system by leveraging Laravel's queueing capabilities.

### Step 4: Example Messages

[](#step-4-example-messages)

#### Example 1: Simple Text Message

[](#example-1-simple-text-message)

```
public function toTelegram(TeleNotifiable $notifiable)
{
    return [
        'text' => 'Hello, this is a simple text message!',
    ];
}
```

#### Example 2: Message with Parse Mode

[](#example-2-message-with-parse-mode)

```
public function toTelegram(TeleNotifiable $notifiable)
{
    return [
        'text' => 'Hello, this message uses *Markdown* parse mode.',
        'parse_mode' => 'Markdown',
    ];
}
```

#### Example 3: Message with Disable Notification

[](#example-3-message-with-disable-notification)

```
public function toTelegram(TeleNotifiable $notifiable)
{
    return [
        'text' => 'Hello, this message will not trigger a notification.',
        'disable_notification' => true,
    ];
}
```

For more customization options, refer to [Telegram Bot API documentation](https://core.telegram.org/bots/api#sendmessage).

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

[](#contributing)

Contributions are welcome!

License
-------

[](#license)

This package is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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

Unknown

Total

1

Last Release

680d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/490876a92d510a97e9a9251f9b10a27282a948c9a7f542e8ae859842a18c0c6e?d=identicon)[alimousavidev](/maintainers/alimousavidev)

---

Top Contributors

[![alimousavidev](https://avatars.githubusercontent.com/u/7754232?v=4)](https://github.com/alimousavidev "alimousavidev (2 commits)")

### Embed Badge

![Health badge](/badges/alimousavi-telenotify/health.svg)

```
[![Health](https://phpackages.com/badges/alimousavi-telenotify/health.svg)](https://phpackages.com/packages/alimousavi-telenotify)
```

###  Alternatives

[mckenziearts/laravel-notify

Flexible flash notifications for Laravel

1.7k1.1M5](/packages/mckenziearts-laravel-notify)[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/apn

Apple APN Push Notification Channel

2021.9M4](/packages/laravel-notification-channels-apn)[laravel-notification-channels/microsoft-teams

A Laravel Notification Channel for Microsoft Teams

1603.0M7](/packages/laravel-notification-channels-microsoft-teams)[laravel-notification-channels/discord

Laravel notification driver for Discord.

2371.3M11](/packages/laravel-notification-channels-discord)[illuminate/mail

The Illuminate Mail package.

5910.1M390](/packages/illuminate-mail)

PHPackages © 2026

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