PHP code example of lakshmaji / plivo

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

    

lakshmaji / plivo example snippets


 Lakshmaji\Plivo\PlivoServiceProvider::class,

'Plivo' => Lakshmaji\Plivo\Facade\Plivo::class,
 
 	php artisan vendor:publish  
 



Use Plivo;

$params = array(
	'src' => '1111111111',
	'dst' => '91999999999',
	'text' => 'Hello world!'
);

Plivo::sendSMS($params);



Use Plivo;

// Lists all messages history
$list_all_messages = Plivo::allMessages();

// Lists the filtered messages (pagination)
$params = array(
	'limit' => 2,
	'offset' => 2,
	'message_direction' => 'inbound',
	'message_state' => 'delivered',
);
$list_some_messages = Plivo::allMessages($params);



Use Plivo;

// Lists all messages history
$list_all_messages = Plivo::allMessages();

// Lists the filtered messages (pagination)
$params = array(
	'limit' => 2,
	'offset' => 2,
	'message_direction' => 'inbound',
	'message_state' => 'delivered',
);
$list_some_messages = Plivo::allMessages($params);



  Use Plivo;

  $params = array(
	  'country_iso' => 'IN'
  );
  
  // List the pricing plans available in a country by using country ISO code
  Plivo::pricing($params);


 
// Define namespace
namespace App\Http\Controllers;

// Include troller extends BaseController
{
    public function sendSMS()
    {
		$params = array(
			'src' => '1111111111',
			'dst' => '91999999999',
			'text' => 'Hello world!'
		);
		
		$response = Plivo::sendSMS($params);
		
}