violetsun / max
MAX Messenger SDK Bot API PHP
v1.1.51
2026-07-16 20:45 UTC
Requires
- php: >=8.0
- ext-json: *
- guzzlehttp/guzzle: ^7.5.1
- guzzlehttp/psr7: ^2.5
- illuminate/database: 9 - 13
- illuminate/support: 9 - 13
- league/event: ^2.2 || ^3.0
- psr/container: ^1.1 || ^2.0
- psr/event-dispatcher: ^1.0
Requires (Dev)
- orchestra/testbench: ~10
- phpunit/phpunit: ~11.0
This package is auto-updated.
Last update: 2026-07-16 20:47:01 UTC
README
Installation
Installing root certificates for working with the MAX API2
- Download root certificates https://www.gosuslugi.ru/crt
- 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
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();
Change log
Please see the changelog for more information on what has changed recently.
Testing
composer test
Contributing
Please see contributing.md for details and a todolist.
Security
If you discover any security related issues, please email demettriss@gmail.com instead of using the issue tracker.