PHP code example of somarkesen / telegram-gateway

1. Go to this page and download the library: Download somarkesen/telegram-gateway library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

somarkesen / telegram-gateway example snippets


return [
    'api_url' => env('TELEGRAM_API_URL', 'https://gatewayapi.telegram.org/'),
    'token' => env('TELEGRAM_API_TOKEN'),
    'timeout' => 30, // Timeout for API requests in seconds
];

use SomarKesen\TelegramGateway\Facades\TelegramGateway;

$response = TelegramGateway::sendVerificationMessage('+1234567890', [
    'code' => '1234',
    'ttl' => 300,
    'callback_url' => 'https://yourapp.com/callback',
]);

$response = TelegramGateway::checkSendAbility('+1234567890');

$response = TelegramGateway::checkVerificationStatus('request-id', '1234');

$response = TelegramGateway::revokeVerificationMessage('request-id');
bash
php artisan vendor:publish --provider="SomarKesen\TelegramGateway\Providers\TelegramGatewayServiceProvider"