PHP code example of williamson / laragram

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

    

williamson / laragram example snippets


	TG::sendMessage('User_name', 'Hi there your account has been set up! Thanks!');

	TG::sendDocument('User_name', '/home/data/files/important.pdf');

	TG::sendImage('User_name', 'http://upload.wikimedia.org/wikipedia/commons/1/16/HDRI_Sample_Scene_Balls_(JPEG-HDR).jpg');

	// $tg is an instantiated TgCommands Object. Laravel will create this out of the IOC container for
	// you if typehinted in constructor etc. 
	$tg->sendMessage('User_name', 'Hi there your account has been set up! Thanks!');

        'Williamson\Laragram\Laravel\LaragramServiceProvider'

        Williamson\Laragram\Laravel\LaragramServiceProvider::class

        'TG' => \Williamson\Laragram\Laravel\LaragramFacade::class,

    'telegram' => [
        'socket' =>'tcp://127.0.0.1:7778'
    ]

   // routes.php

     Route::get('/test', function (){
          TG::sendMsg('<name or telegram id number>', 'Hello there!');
     });