PHPackages                             micromagicman/laravel-telegram-webapp - 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. micromagicman/laravel-telegram-webapp

ActiveLibrary

micromagicman/laravel-telegram-webapp
=====================================

Laravel middleware for Telegram WebApp data validation

v4.0.0(11mo ago)263.9k—0%5[1 issues](https://github.com/micromagicman/laravel-telegram-webapp/issues)MITPHPPHP &gt;=8.3CI passing

Since Nov 21Pushed 11mo ago1 watchersCompare

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

READMEChangelog (6)Dependencies (7)Versions (8)Used By (0)

Laravel Telegram WebApp package
===============================

[](#laravel-telegram-webapp-package)

[![build](https://github.com/micromagicman/laravel-telegram-webapp/actions/workflows/laravel-telegram-webapp-ci.yml/badge.svg)](https://github.com/micromagicman/laravel-telegram-webapp/actions/workflows/laravel-telegram-webapp-ci.yml/badge.svg)[![codecov](https://camo.githubusercontent.com/86414fa099d192028478adc7689c12e5ac46e8419669726ab1ae795547bfbf62/68747470733a2f2f636f6465636f762e696f2f6769746875622f6d6963726f6d616769636d616e2f6c61726176656c2d74656c656772616d2d7765626170702f67726170682f62616467652e7376673f746f6b656e3d5a535646374d47423338)](https://codecov.io/github/micromagicman/laravel-telegram-webapp)

Laravel package that allows you to process commands from Telegram MiniApp with user verification according to [Telegram MiniApp developer documentation](https://core.telegram.org/bots/webapps), as well as obtaining information about the Telegram user who sent the request

Requirements
------------

[](#requirements)

Laravelmicromagicman/laravel-telegram-webapp10.x1.x.x11.x2.x.x12.x3.x.xInstall
-------

[](#install)

### Via composer

[](#via-composer)

```
composer require micromagicman/laravel-telegram-webapp
```

### Publishing

[](#publishing)

Publish to your Laravel application:

```
php artisan vendor:publish --provider="Micromagicman\TelegramWebApp\TelegramWebAppServiceProvider"
```

Configure
---------

[](#configure)

All package configuration available in `config/telegram-webapp.php` file after `publish` command execution:

Config nameDescriptionEnvironmentDefault value`enabled`Telegram MiniApp data validation switch`TELEGRAM_WEBAPP_DATA_VALIDATION_ENABLED``true``webAppScriptLocation`Path to script (.js) which initializes Telegram MiniApp on your frontend app-`https://telegram.org/js/telegram-web-app.js``botToken`Your Telegram bot token`TELEGRAM_BOT_TOKEN`-`error.status`HTTP status code when Telegram MiniApp data validation fails-403 (Forbidden)`error.message`Error message returned when Telegram MiniApp data validation fails-403 (Forbidden)`authDateLifetimeSeconds`The lifetime of the Telegram initData auth\_date parameter in seconds. The request to the server must be made within this interval, otherwise the data transmitted from Telegram will be considered invalid. The values of the parameter &lt;= 0 imply that there is no verification of the lifetime of data from telegram and the auth\_date parameter is not validated-0Example in code:

View
----

[](#view)

This package provides a root view for Telegram MiniApp frontend applications. [Telegram WebApp script](https://telegram.org/js/telegram-web-app.js) is automatically includes to this view or its inheritors if `telegram-webapp.enabled` switch is `true`

Example:

```
@extends('telegram-webapp::main')

@section('lang', 'CN')

@section('head')
// some scripts, css, meta
@endsection

@section('title', 'My title')

@section('content')

        // My spa content

@endsection
```

Integration with `TelegramBot\Api\BotApi`
-----------------------------------------

[](#integration-with-telegrambotapibotapi)

Our service integrates with `TelegramBot\Api\BotApi`, allowing you to access all of the methods provided by the Telegram Bot API. This integration is available either through a **Facade** or directly through the service.

You can find the repository for `TelegramBot\Api\BotApi` [here](https://github.com/TelegramBot/Api).

### Using the Facade

[](#using-the-facade)

To use the Telegram Bot API methods, you can leverage the **TelegramWebAppFacade** facade. This provides a simple and convenient way to interact with the Telegram Bot API.

Example usage with the Facade:

```
use Micromagicman\TelegramWebApp\Facades\TelegramWebApp;

$response = TelegramWebApp::getMe();
```

This allows you to call methods like `getMe()`, `sendMessage()`, `getUpdates()`, and any other method from the `BotApi` class directly through the facade.

### Using the Service Directly

[](#using-the-service-directly)

You can also interact with the Telegram Bot API directly through the service. Inject the `TelegramWebAppService` into your components, and call the Bot API methods via the service instance.

Example usage in a controller:

```
use Micromagicman\TelegramWebApp\Services\TelegramWebAppService;

class MyController extends Controller
{
    protected $telegram;

    public function __construct(TelegramWebAppService $telegram)
    {
        $this->telegram = $telegram;
    }

    public function getBotInfo()
    {
        $response = $this->telegram->getMe();
        return response()->json($response);
    }
}
```

Both the facade and the service offer full access to the `BotApi` class methods, allowing you to work seamlessly with the Telegram Bot API in your Laravel application.

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance50

Moderate activity, may be stable

Popularity33

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity61

Established project with proven stability

 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

Every ~100 days

Recently: every ~91 days

Total

6

Last Release

347d ago

Major Versions

v1.0.0 → v2.0.02024-04-08

v2.2.0 → v3.0.02025-04-08

v3.0.0 → v4.0.02025-04-09

PHP version history (3 changes)v1.0.0PHP &gt;=8.1

v2.0.0PHP &gt;=8.2

v3.0.0PHP &gt;=8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/d5c708ca832045fad92e80900cbc2933b956a760ae15acd53dff80214afb8167?d=identicon)[micromagicman](/maintainers/micromagicman)

---

Top Contributors

[![micromagicman](https://avatars.githubusercontent.com/u/25100894?v=4)](https://github.com/micromagicman "micromagicman (33 commits)")

---

Tags

laravellaravel-telegram-miniapplaravel-telegram-webappminiapptelegramtelegram-bottelegram-mini-apptelegram-web-applaravelbottelegramminiapp

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/micromagicman-laravel-telegram-webapp/health.svg)

```
[![Health](https://phpackages.com/badges/micromagicman-laravel-telegram-webapp/health.svg)](https://phpackages.com/packages/micromagicman-laravel-telegram-webapp)
```

###  Alternatives

[nutgram/nutgram

The Telegram bot library that doesn't drive you nuts

699196.9k7](/packages/nutgram-nutgram)[php-telegram-bot/laravel

Integrates PHP Telegram Bot into Laravel.

1858.9k](/packages/php-telegram-bot-laravel)[guanguans/laravel-exception-notify

Monitor exception and report to the notification channels(Dump、Log、Mail、AnPush、Bark、Chanify、DingTalk、Discord、Gitter、GoogleChat、IGot、Lark、Mattermost、MicrosoftTeams、NowPush、Ntfy、Push、Pushback、PushBullet、PushDeer、PushMe、Pushover、PushPlus、QQ、RocketChat、ServerChan、ShowdocPush、SimplePush、Slack、Telegram、WeWork、WPush、XiZhi、YiFengChuanHua、ZohoCliq、ZohoCliqWebHook、Zulip).

14241.9k1](/packages/guanguans-laravel-exception-notify)[ricardofontanelli/laravel-telegram

A simple and lightweight Laravel 4 and 5 wrapper to interact with Telegram Bot.

103.6k](/packages/ricardofontanelli-laravel-telegram)

PHPackages © 2026

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