php-core / laravel-madeline-proto
A third party Telegram client library danog/MadelineProto wrapper for Laravel
Installs: 19
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 49
pkg:composer/php-core/laravel-madeline-proto
Requires
- php: ^8.4
- danog/madelineproto: ^8.6
- illuminate/console: *
- illuminate/database: *
- illuminate/support: *
Requires (Dev)
- mockery/mockery: ^1.6
- orchestra/testbench: ^10.0
- pestphp/pest: ^3.0
- pestphp/pest-plugin-laravel: ^3.0
This package is auto-updated.
Last update: 2025-10-16 22:11:29 UTC
README
A third party Telegram client library danog/MadelineProto wrapper for Laravel. Updated to support latest MadelineProto and PHP 8.4 by PHPCore
Getting Started
Add the laravel-madeline-proto to the project dependency:
composer require php-core/laravel-madeline-proto
Then publish the telegram.php
config file:
php artisan vendor:publish --provider="PHPCore\MadelineProto\MadelineProtoServiceProvider"
Set up the Telegram API key by providing env variables:
MP_TELEGRAM_API_ID=... //your telegram api id here MP_TELEGRAM_API_HASH=... //your telegram api hash here
This wrapper package supports for running both single / multiple telegram account.
Dig Deeper
Please check wiki for more details about laravel-madeline-proto usage
Testing
Automated Testing
This package uses Pest PHP for automated testing. To run the test suite:
composer test
For more details on automated testing, see TESTING.md.
Manual Testing with Telegram
To test the package with actual Telegram API connections locally:
- Copy
.env.example
to.env
and add your credentials - Run the test script:
php test-telegram.php
- Send test messages:
php test-send-message.php "Hello!"
For detailed instructions, see MANUAL_TESTING.md.
Integration Tests
Run integration tests that interact with real Telegram API:
export MP_INTEGRATION_TESTS=true
vendor/bin/pest tests/Integration
These tests will send actual messages to the chat ID configured in MP_TEST_CHAT_ID
(defaults to "me" for Saved Messages).
Notes
-
This wrapper package is still not wrapping all the apis yet, I'm still focusing on wrapping the messages api.
-
If you can't find the method that you want in Messages facade or need to use the default danog/MadelineProto api, you might want to use
MadelineProto::getClient()
facade method. It will returndanog\MadelineProto\API
object where you can call all the method provided by the danog/MadelineProto library.
Thanks To
setiawanhu for the base version this package is based on
Bryan Ramaputra for helping me to write readable documentations.