PHP code example of codebuglab / letsbot-php

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

    

codebuglab / letsbot-php example snippets




$lb = (new \LetsBot\Api\LetsBot);
$lb::$api_key = 'your_api_key'; // Set API key
$lb::$ssl_verify = false; // Set SSL verification (true/false, default is true)

$result = $lb->ChatList()->send();
echo json_encode($result);

return [
  'api_key' => env('LETS_BOT_API_KEY', 'test'),
  'ssl_verify' => true,
];

// In Laravel
use LetsBot;

return LetsBot::sessionStatus()->send();

// OR use the helper function
return lb()->sessionStatus()->send();

   LetsBot::method()->param1(value)->param2(value)->send();
   

   LetsBot::method()->send([
     'param1' => value,
     'param2' => value
   ]);
   

// Fluent interface
LetsBot::message()
    ->phone('1234567890')
    ->body('Hello from LetsBot!')
    ->send();
bash
composer 
bash
php artisan vendor:publish --tag=letsbot-config