A third party Telegram client library danog/MadelineProto wrapper for Laravel. Updated to support latest MadelineProto and PHP 8.4 by PHPCore
Add the laravel-madeline-proto to the project dependency:
composer require php-core/laravel-madeline-protoThen 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 hereThis wrapper package supports for running both single / multiple telegram account.
Please check wiki for more details about laravel-madeline-proto usage
This package uses Pest PHP for automated testing. To run the test suite:
composer testFor more details on automated testing, see TESTING.md.
To test the package with actual Telegram API connections locally:
- Copy
.env.exampleto.envand 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.
Run integration tests that interact with real Telegram API:
export MP_INTEGRATION_TESTS=true
vendor/bin/pest tests/IntegrationThese tests will send actual messages to the chat ID configured in MP_TEST_CHAT_ID (defaults to "me" for Saved Messages).
-
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\APIobject where you can call all the method provided by the danog/MadelineProto library.
setiawanhu for the base version this package is based on
Bryan Ramaputra for helping me to write readable documentations.