PHPackages                             violetsun/max - 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. violetsun/max

ActiveLibrary[API Development](/categories/api)

violetsun/max
=============

MAX Messenger SDK Bot API PHP

v1.2.4(3w ago)5165MITPHPPHP &gt;=8.0CI failing

Since Feb 18Pushed 3w agoCompare

[ Source](https://github.com/VioletSun/MAX)[ Packagist](https://packagist.org/packages/violetsun/max)[ Docs](https://github.com/violetsun/max)[ RSS](/packages/violetsun-max/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (8)Dependencies (75)Versions (90)Used By (0)

MAX
===

[](#max)

[![API MAX](https://camo.githubusercontent.com/a388145634fb1566481b7afb40ef0d284e890f40aa3dc336a1558187d8001e22/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4f6666696369616c5f4150495f646f632d4d41582d3866336666663f6c6f676f3d6d6573736167652d737175617265267374796c653d666c61742d737175617265)](https://dev.max.ru/docs)[![Project Status](https://camo.githubusercontent.com/a6bc3e567fa47bf45f9b830108a8f3f011dea5535e0bf60f129ecf9d578263df/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5374617475732d496e253230646576656c6f706d656e742d6f72616e67652e737667)](https://github.com/VioletSun/MAX/blob/main/TODO.md)

[![Laravel versions](https://camo.githubusercontent.com/3fce586d1f57e6dbbc1d8168cba564ae3c86e7e059abe3aa49ca8eb28ada6aa6/68747470733a2f2f62616467652e6c61726176656c2e636c6f75642f62616467652f77656e64656c6c61647269656c2f6c61726176656c2d657870726573736976653f7374796c653d666c6174)](https://github.com/VioletSun/MAX)[![Laravel](https://camo.githubusercontent.com/ef6603fab3e4e6f1cf52794b9ba242e4fbb0fd7faeae8acb6e0de746b5169698/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c5061636b6167652d617661696c61626c652d737563636573733f6c6f676f3d6c61726176656c267374796c653d666c61742d737175617265)](https://github.com/VioletSun/MAX)[![Latest Version on Packagist](https://camo.githubusercontent.com/b471eaccdd64364a9902cebe96fe2b6b6b1a3e70b06ac0fa606a2eddfa70c3eb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f76696f6c657473756e2f6d61782e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/violetsun/max)[![PHP version](https://camo.githubusercontent.com/fcc7ce4282ac4b8d6bd699b4ef26eed30fc624733987eaa797097f83195eb149/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d382e322d3377656667332e7376673f7374796c653d666c61742d737175617265)](https://github.com/VioletSun/MAX)[![Total Downloads](https://camo.githubusercontent.com/6fce158c1aa9ed3a68471580fde0075e8c6c4610ae87fefc07f9ef6e431db77a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f76696f6c657473756e2f6d61782e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/violetsun/max)[![GitHub code size in bytes](https://camo.githubusercontent.com/6561958964f80577845be3c7f632850c8007927ad3e92f31450111c81161e128/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c616e6775616765732f636f64652d73697a652f56696f6c657453756e2f4d4158)](https://camo.githubusercontent.com/6561958964f80577845be3c7f632850c8007927ad3e92f31450111c81161e128/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c616e6775616765732f636f64652d73697a652f56696f6c657453756e2f4d4158)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)

Functionality
-------------

[](#functionality)

`violetsun/max` is a Laravel package for integration with the official MAX API.

The package provides a convenient way to work with MAX bots and chats directly from a Laravel application: sending messages, uploading files, working with attachments, handling chats and users, and using a fluent message builder.

### Main features

[](#main-features)

- Integration with the official MAX API.
- Laravel facade for simple API calls.
- Sending text messages to chats and users.
- Editing and deleting messages.
- Fluent `MessageBuilder` for building complex messages.
- Support for message attachments:
    - images;
    - videos;
    - audio;
    - files;
    - stickers;
    - contacts;
    - locations;
    - shared links;
    - inline keyboards.
- Uploading local files to MAX and using returned upload tokens.
- Inline keyboard builder with support for:
    - callback buttons;
    - link buttons;
    - geolocation request buttons;
    - contact request buttons;
    - open app buttons;
    - message buttons;
    - clipboard buttons.
- Eloquent models for storing MAX users and chats.
- Many-to-many relation between MAX chats and MAX users.
- Optional saving of update data in the application database.
- Optional queue support for processing updates.
- Publishable config, migrations, models, assets and services.

### Laravel integration

[](#laravel-integration)

The package registers a Laravel service provider and exposes the MAX API client through the `MAX` facade:

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

[](#installation)

Installing root certificates for working with the MAX API2

- Download root certificates
- Install certificates `sudo cp CERTIFICATE_NAME.crt /usr/local/share/ca-certificates/`
- Update the certificate store `sudo update-ca-certificates`

Via Composer

```
composer require violetsun/max
```

Package vendor publish

```
php artisan vendor:publish --provider="VioletSun\MAX\MAXServiceProvider"
```

or

```
php artisan vendor:publish --tag=max-config
php artisan vendor:publish --tag=max-migrations
php artisan vendor:publish --tag=max-models
php artisan vendor:publish --tag=max-assets
php artisan vendor:publish --tag=max-services
```

Migrations (after vendor publish)

```
php artisan migrate
```

.env

```
MAX_API_KEY="YOUR_MAX_API_KEY"
```

Usage
-----

[](#usage)

**Send message**

```
MAX::sendMessage(
    1234567890,
    [
        'text' => 'Lorem Ipsum is simply dummy text of the printing and typesetting industry.'
        // there will be more to come...
    ]
);
```

**Send message with MessageBuilder**

```
Max::builder()
    ->chatId(1234567890)
    ->text("Lorem Ipsum is simply dummy text of the printing and typesetting industry.")
    ->attachments(function (AttachmentsBuilder $builder) {
        $builder->image(
            token: "TOKEN_IMAGE"
        );
        $builder->image(store: public_path('image.png'));
        $builder->video(
            token: "TOKEN_VIDEO"
        );
        $builder->inlineKeyboard(
            $builder->row(
                $builder->button->link(
                    text: "Lorem Ipsum 1",
                    url: "https://max.ru",
                ),
                $builder->button->callback(
                    text: "Lorem Ipsum 2",
                    payload: "lorem-ipsum-2",
                )
            ),
            $builder->button->callback(
                text: "Lorem Ipsum 3",
                payload: "lorem-ipsum-3",
            )
        );
    })
    ->send();
```

**Send message with Queue**

```
Max::builder()
    ->chatId(1234567890)
    ->text("Lorem Ipsum is simply dummy text of the printing and typesetting industry.")
    ->attachments(function (AttachmentsBuilder $builder) {
        $builder->image(
            token: "TOKEN_IMAGE"
        );
        $builder->inlineKeyboard(
            $builder->button->callback(
                text: "Lorem Ipsum 1",
                payload: "lorem-ipsum-1",
            )
        );
    })
    ->queue();
```

```
$queueMessage = MaxMessageQueue::query()->first();
$queueMessage?->sendQueuedMessage();
```

or in routes/console.php

```
use Illuminate\Support\Facades\Schedule;

Schedule::command('max:message-queue:handle')
    ->everyThirtySeconds()
    ->withoutOverlapping();
```

After this, the Laravel scheduler should be started:

```
php artisan schedule:work
```

For production, it is usually run via cron every minute:

```
* * * * * cd /path/to/project && php artisan schedule:run >> /dev/null 2>&1
```

Change log
----------

[](#change-log)

Please see the [changelog](changelog.md) for more information on what has changed recently.

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  instead of using the issue tracker.

Credits
-------

[](#credits)

- [demettriss](https://github.com/violetsun)
- [All Contributors](../../contributors)

License
-------

[](#license)

[license file](LICENSE)

###  Health Score

47

—

FairBetter than 93% of packages

Maintenance95

Actively maintained with recent releases

Popularity19

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity56

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

Every ~2 days

Total

89

Last Release

22d ago

Major Versions

v0.0.1 → v1.0.0.12026-02-18

### Community

Maintainers

![](https://www.gravatar.com/avatar/334511d453f87886f538ab18b453af45451d5ce9676578723251fea1e9a09a0a?d=identicon)[demettriss](/maintainers/demettriss)

---

Top Contributors

[![demettriss](https://avatars.githubusercontent.com/u/7983551?v=4)](https://github.com/demettriss "demettriss (115 commits)")

---

Tags

phpapilaravelsdkbotmaxmax-botlaravel max botlaravel maxlaravel max sdkmax bot apimax phpmax sdk

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/violetsun-max/health.svg)

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

###  Alternatives

[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

353.6k](/packages/eslazarev-wildberries-sdk)[aws/aws-sdk-php

AWS SDK for PHP - Use Amazon Web Services in your PHP project

6.2k555.0M2.8k](/packages/aws-aws-sdk-php)[drupal/core-recommended

Locked core dependencies; require this project INSTEAD OF drupal/core.

6943.5M449](/packages/drupal-core-recommended)[typo3/cms

TYPO3 CMS is a free open source Content Management Framework initially created by Kasper Skaarhoj and licensed under GNU/GPL.

1.2k1.9M122](/packages/typo3-cms)[bushlanov-dev/max-bot-api-client-php

Max Bot API Client library

488.7k](/packages/bushlanov-dev-max-bot-api-client-php)[simplestats-io/laravel-client

Server-side analytics for Laravel that follows the full funnel from visit to registration to payment, attributed to the channel that drove it. Revenue, MRR, churn and ad-spend profit (ROAS/CAC) per channel. GDPR compliant, ad-blocker proof.

5226.7k](/packages/simplestats-io-laravel-client)

PHPackages © 2026

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