PHPackages                             milly/laragram - 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. [API Development](/categories/api)
4. /
5. milly/laragram

ActiveLibrary[API Development](/categories/api)

milly/laragram
==============

Laravel package to develop telegram bot inside laravel project

5.0.1(1y ago)443.4k↓45.8%61MITPHPCI passing

Since Jan 22Pushed 7mo ago1 watchersCompare

[ Source](https://github.com/Mirmuxsin/laragram)[ Packagist](https://packagist.org/packages/milly/laragram)[ Patreon](https://www.patreon.com/millykhamroev)[ RSS](/packages/milly-laragram/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (2)Versions (44)Used By (1)

LARAGRAM
========

[](#laragram)

###  Simple laravel package to use telegram bot API inside your laravel project

[](#----simple-laravel-package-to-use-telegram-bot-api-inside-your-laravel-project)

 [![License](https://camo.githubusercontent.com/e33622fc1b97141369718deb4c4d6887c4b14ba1e1ffbc5dbbb0c6efddc7b199/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6d69726d757873696e2f6c6172616772616d3f636f6c6f723d253233666566656665266c6f676f3d676974687562266c6f676f436f6c6f723d253233666566656665267374796c653d666c61742d737175617265)](https://github.com/Mirmuxsin/laragram/blob/master/license) [![Packagist Version](https://camo.githubusercontent.com/1c8e085281388431344493a7a652374b6e6850a69b4512a4b0911192600b091b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d696c6c792f6c6172616772616d3f636f6c6f723d253233666566656665266c6162656c3d4c6172616772616d266c6f676f3d7061636b6167697374266c6f676f436f6c6f723d253233666566656665267374796c653d666c61742d737175617265)](https://packagist.org/packages/milly/laragram) [![Packagist Version](https://camo.githubusercontent.com/798fbc1f752833c8b4125f06886b5de126f676f7e603af781d794a0efa5075a5/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4275792532306d65253230612d636f666665652d2532336665666566653f7374796c653d666c61742d737175617265266c6f676f3d70617472656f6e266c6f676f436f6c6f723d253233666566656665)](https://www.patreon.com/millykhamroev)

---

- [Features](#Features)
- [Installation](#Installation)
- [Usage](#Usage)

---

Features
--------

[](#features)

### It has every method of telegram bot api:

[](#it-has-every-method-of-telegram-bot-api)

[![img_1.png](img/img_1.png)](img/img_1.png)

### Which are fully documented:

[](#which-are-fully-documented)

[![img_2.png](img/img_2.png)](img/img_2.png)

### Now you don't have to remember which property is in which object, because they are documented too):

[](#now-you-dont-have-to-remember-which-property-is-in-which-object-because-they-are-documented-too)

[![img_3.png](img/img_3.png)](img/img_3.png)

### Which you can get directly throuhg your function:

[](#which-you-can-get-directly-throuhg-your-function)

[![img_5.png](img/img_5.png)](img/img_5.png)

### BTW, you can call many of them at once:

[](#btw-you-can-call-many-of-them-at-once)

[![img_6.png](img/img_6.png)](img/img_6.png)

### It supports FSM-Routing:

[](#it-supports-fsm-routing)

[![img_8.png](img/img_8.png)](img/img_8.png)

---

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

[](#installation)

> This package requires PHP 8.0+

First, install Laragram package, and make sure that the database connection settings are correct!

```
composer require milly/laragram
```

Then run these commands to publish assets and config

```
php artisan vendor:publish --provider="Milly\Laragram\LaragramServiceProvider"
```

Add your telegram bot token to .env

```
TELEGRAM_BOT_TOKEN=123456789:XXXXXXXXXXXXXXXXXXXXXXXXXXX
```

Run migration to be able to use FSM-Routing

```
php artisan migrate
```

If you want to get updates, set webhook to your adress (like domain.com/api/bot) where you handle updates

And here we go, you can start your bot now

---

Usage:
------

[](#usage)

- Local development:

    ```
    php artisan laragram:start
    ```
- Methods:

    ```
    use Milly\Laragram\Laragram;

    Laragram::sendMessage(
        123456789, // chat_id
        null, // message thread id
        "Hello world", // message text
    );
    ```
- Objects:

    ```
    use Milly\Laragram\Types\Message;

    // with variable
    $message = new Message();
    $text = $message->text;

    // inside the function
    function getText(Message $message) {
        $text = $message->text;
    }
    ```
- FSM Routing:

    ```
    // routes/api.php
    use Milly\Laragram\FSM\FSM;
    use Milly\Laragram\Laragram;

    Route::post('/bot', function () {

       FSM::route('state_1', [SomeClass::class, 'someMethod']);

        FSM::route('state_2', function (Message $message) {
            Laragram::sendMessage(
                $message->chat->id,
                null,
                "Inside anonymous function"
            );
        });
    }
    ```

---

2.3 version
===========

[](#23-version)

- Support for anonymous functions inside route definition

```
// routes/laragram.php

use App\Http\Controllers\LaragramController;
use Milly\Laragram\FSM\FSM;
use \Milly\Laragram\Types\Message;
use \Milly\Laragram\Laragram;

FSM::route('', function (Message $message) {
    Laragram::sendMessage([
        $message->chat->id,
        null,
        "Inside anonymous function"
    );
}, [
  (new \Milly\Laragram\Types\Update())->message
]);
```

- State management now supports regexp as status

```
// routes/laragram.php

//...
FSM::route('state_+', [SomeClass::class, 'someMethod']);
```

- minor fixes

### Use it inside laravel project as a package and you will be able to use all features, including:

[](#use-it-inside-laravel-project-as-a-package-and-you-will-be-able-to-use-all-features-including)

- route middleware
- multi-lang
- guards
- CLI
- migration
- and others and others

---

### Changes:

[](#changes)

- [Added specific routes](https://github.com/Mirmuxsin/laragram/commit/15d8339b776a1c7f27890fa432cac23aa7625772#diff-35fbaa003e989ec8dcb1ac861c7c592e8e4bda9e121395590e86c0ff2da8bd82)
- [Added config files](https://github.com/Mirmuxsin/laragram/commit/15d8339b776a1c7f27890fa432cac23aa7625772#diff-d27544c268b9ad05a341ea07100f640cab3a646464bb7ca6652ac0e579056722)
- [Added hints for IDE](https://github.com/Mirmuxsin/laragram/commit/ed072afacdb30da40d87447d8a30e17fc54b6d8f#diff-96559060a0c25e1a9513eb0545bebd99636c5f29e02ae6101ed0061de81e7d67)

###  Health Score

45

—

FairBetter than 93% of packages

Maintenance53

Moderate activity, may be stable

Popularity34

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 69.1% 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 ~32 days

Recently: every ~46 days

Total

41

Last Release

304d ago

Major Versions

1.0.4 → 2.0.02022-07-25

2.2.2 → 3.0.02023-11-20

3.2.1 → 4.0.02024-07-20

4.0.0 → 5.0.02025-01-15

### Community

Maintainers

![](https://www.gravatar.com/avatar/965a03f16af543c5f16fc4da02734c22679947127b960c7aa93185804105c909?d=identicon)[Mirmuxsin](/maintainers/Mirmuxsin)

---

Top Contributors

[![Mirmuxsin](https://avatars.githubusercontent.com/u/58307677?v=4)](https://github.com/Mirmuxsin "Mirmuxsin (67 commits)")[![mtakhirov](https://avatars.githubusercontent.com/u/88322285?v=4)](https://github.com/mtakhirov "mtakhirov (17 commits)")[![SamixGroup](https://avatars.githubusercontent.com/u/30470723?v=4)](https://github.com/SamixGroup "SamixGroup (6 commits)")[![khamdullaevuz](https://avatars.githubusercontent.com/u/81905341?v=4)](https://github.com/khamdullaevuz "khamdullaevuz (3 commits)")[![imanghafoori1](https://avatars.githubusercontent.com/u/6961695?v=4)](https://github.com/imanghafoori1 "imanghafoori1 (2 commits)")[![kriptogenic](https://avatars.githubusercontent.com/u/25981680?v=4)](https://github.com/kriptogenic "kriptogenic (1 commits)")[![ImgBotApp](https://avatars.githubusercontent.com/u/31427850?v=4)](https://github.com/ImgBotApp "ImgBotApp (1 commits)")

---

Tags

laraveltelegramtelegram-bot

### Embed Badge

![Health badge](/badges/milly-laragram/health.svg)

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

###  Alternatives

[skagarwal/google-places-api

Google Places Api

1913.0M8](/packages/skagarwal-google-places-api)[dcblogdev/laravel-microsoft-graph

A Laravel Microsoft Graph API (Office365) package

168285.5k1](/packages/dcblogdev-laravel-microsoft-graph)[vluzrmos/slack-api

Wrapper for Slack.com WEB API.

102589.1k3](/packages/vluzrmos-slack-api)[smodav/mpesa

M-Pesa API implementation

16363.7k1](/packages/smodav-mpesa)[jasara/php-amzn-selling-partner-api

A fluent interface for Amazon's Selling Partner API in PHP

1344.8k1](/packages/jasara-php-amzn-selling-partner-api)[grantholle/powerschool-api

A Laravel package to make interacting with PowerSchool less painful.

1715.6k1](/packages/grantholle-powerschool-api)

PHPackages © 2026

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