PHPackages                             ermanojbisht/mkb-laravel-telegram-login-widget - 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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. ermanojbisht/mkb-laravel-telegram-login-widget

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

ermanojbisht/mkb-laravel-telegram-login-widget
==============================================

Easily integrate Telegrams login widget into your Laravel application to send Telegram messages

029PHP

Since Feb 7Pushed 4mo agoCompare

[ Source](https://github.com/ermanojbisht/mkb-laravel-telegram-login-widget)[ Packagist](https://packagist.org/packages/ermanojbisht/mkb-laravel-telegram-login-widget)[ RSS](/packages/ermanojbisht-mkb-laravel-telegram-login-widget/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

TelegramLoginWidget
===================

[](#telegramloginwidget)

[![Latest Version on Packagist](https://camo.githubusercontent.com/2fbf7117144ae7950d5c054e8718cb159a7604c50374fe33b73176d0ad2c019c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f707363686f636b652f6c61726176656c2d74656c656772616d2d6c6f67696e2d7769646765742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/pschocke/laravel-telegram-login-widget)[![Total Downloads](https://camo.githubusercontent.com/bfc853e412d67ca56f1239281818f8495865ef0531ba45a7c8925525cb514bae/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f707363686f636b652f6c61726176656c2d74656c656772616d2d6c6f67696e2d7769646765742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/pschocke/laravel-telegram-login-widget)[![run-tests](https://github.com/pschocke/laravel-telegram-login-widget/workflows/run-tests/badge.svg?branch=master)](https://github.com/pschocke/laravel-telegram-login-widget/workflows/run-tests/badge.svg?branch=master)[![Quality Score](https://camo.githubusercontent.com/afe7bdd7d25760a6bcc7d1fa6c11eba7c8a58c07d5b7b512b9fe29502778736f/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f707363686f636b652f6c61726176656c2d74656c656772616d2d6c6f67696e2d7769646765742e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/pschocke/laravel-telegram-login-widget)[![StyleCI](https://camo.githubusercontent.com/ec2dd6b14b085af601f17810a9b893c6d9dfa715488a6208bf6c0e9dc1f3c0c0/68747470733a2f2f7374796c6563692e696f2f7265706f732f3234323534393139362f736869656c64)](https://styleci.io/repos/242549196)[![codecov](https://camo.githubusercontent.com/fc51453eac73c7cbcde5e5430698169869624a7dcb9253e9728c5d0c588a1276/68747470733a2f2f636f6465636f762e696f2f67682f707363686f636b652f6c61726176656c2d74656c656772616d2d6c6f67696e2d7769646765742f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/pschocke/laravel-telegram-login-widget)

Laravel Telegram Login Widget. Easily integrate Telegrams login widget to send Telegram messages.

You can view a full video of the installation process an usage [here](https://www.youtube.com/watch?v=tUATaHDW6FY), where we build an app that sends Telegram notifications from start to finish.

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

[](#installation)

Via Composer

```
composer require pschocke/laravel-telegram-login-widget
```

Then publish the configuration file

```
php artisan vendor:publish --tag=telegramloginwidget.config
```

Usage
-----

[](#usage)

First you have to [create a bot](https://core.telegram.org/bots#3-how-do-i-create-a-bot) at Telegram. After that [set up your login widget](https://core.telegram.org/widgets/login) in your frontend.

Create an env variable `TELEGRAM_BOT_TOKEN` with your bots token

Create a route to handle the callback/redirect after the the successful connection between the user account and your telegram bot. Telegram uses a hash to allow you to verify the response is from Telegram. Here comes this package in play:

```
use pschocke\TelegramLoginWidget\Facades\TelegramLoginWidget;

class TelegramCallbackController extends Controller {

    public function __invoke(Request $request) {
        if($telegramUser = TelegramLoginWidget::validate($request)) {
            // user is valid
        }
        // telegram response is not valid. Account connection failed
    }
}
```

if you want more control over the response, you can use the `validateWithError()` method to catch more fine tuned errors:

```
use pschocke\TelegramLoginWidget\Facades\TelegramLoginWidget;

class TelegramCallbackController extends Controller {

    public function __invoke(Request $request) {
        $telegramUser = [];
        try {
            $telegramUser = TelegramLoginWidget::validateWithError($request);
        } catch(pschocke\TelegramLoginWidget\Exceptions\HashValidationException $e) {
            // the response is not from telegram
        } catch(pschocke\TelegramLoginWidget\Exceptions\ResponseOutdatedException $e) {
            // the response is outdated.
        }
    }
}
```

At this stage, `$telegramUser` contains a collection of all attributes Telegram provides: id, first\_name, last\_name, username, photo\_url and auth\_date.

```
echo $telegramUser->first_name; // Max
echo $telegramUser->last_name; // Mustermann
```

Testing
-------

[](#testing)

```
$ composer test
```

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

[](#contributing)

Please see [contributing.md](contributing.md) for details and a todolist.

Security
--------

[](#security)

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

Credits
-------

[](#credits)

- [Patrick Schocke](https://github.com/pschocke)
- [All Contributors](../../contributors)

License
-------

[](#license)

MIT. Please see the [license file](license.md) for more information.

###  Health Score

19

—

LowBetter than 9% of packages

Maintenance50

Moderate activity, may be stable

Popularity7

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity12

Early-stage or recently created project

 Bus Factor1

Top contributor holds 88.5% 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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/14798214?v=4)[Manoj Bisht](/maintainers/ermanojbisht)[@ermanojbisht](https://github.com/ermanojbisht)

---

Top Contributors

[![pschocke](https://avatars.githubusercontent.com/u/26882621?v=4)](https://github.com/pschocke "pschocke (46 commits)")[![ermanojbisht](https://avatars.githubusercontent.com/u/14798214?v=4)](https://github.com/ermanojbisht "ermanojbisht (6 commits)")

### Embed Badge

![Health badge](/badges/ermanojbisht-mkb-laravel-telegram-login-widget/health.svg)

```
[![Health](https://phpackages.com/badges/ermanojbisht-mkb-laravel-telegram-login-widget/health.svg)](https://phpackages.com/packages/ermanojbisht-mkb-laravel-telegram-login-widget)
```

###  Alternatives

[vitalybaev/laravel5-dkim

Laravel 5/6 package for signing outgoing messages with DKIM.

3163.1k](/packages/vitalybaev-laravel5-dkim)

PHPackages © 2026

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