PHP code example of ricardofontanelli / laravel-telegram

1. Go to this page and download the library: Download ricardofontanelli/laravel-telegram 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/ */

    

ricardofontanelli / laravel-telegram example snippets


    'providers' => array(
        // ...
        'RicardoFontanelli\LaravelTelegram\TelegramServiceProvider',
    )

    'aliases' => array(
        // ...
        'Telegram' => 'RicardoFontanelli\LaravelTelegram\TelegramFacade',
    )
 
php artisan config:publish ricardofontanelli/laravel-telegram
 
php artisan vendor:publish --provider="RicardoFontanelli\LaravelTelegram\TelegramServiceProvider"
 artisan tinker

// Send a message
Telegram::sendMessage('default', 'Here we go!');
// or async
Telegram::async()->sendMessage('default', 'Here we go!');

// Send an async message
Telegram::getMe()->getResult();

// Send an async message
Telegram::getUpdates()->getResult();

$params = ['method'=>'GET'];
Telegram::getWebhookInfo($params)->getResult()
sh
php composer update
app/config/packages/ricardofontanelli/laravel-telegram/config.php
app/config/telegram.php