PHP code example of midnite81 / plivo

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

    

midnite81 / plivo example snippets


'providers' => [
  Midnite81\Plivo\MessagingServiceProvider::class
];

'aliases' => [
  'Messaging' => Midnite81\Plivo\Facades\Messaging::class,
];

Messaging::get('foo');

public function __construct(Midnite81\Plivo\Contracts\Services\Messaging $messaging)
{
    $this->messaging = $messaging;
}

use Midnite81\Plivo\Contracts\Services\Messaging;
    
public function sendMessage(Messaging $messaging) 
{
    $msg = $messaging->msg('Hello World!')->to('0123456789')->sendMessage(); 
}

// Or you can simply use the helper function
   
text('+44123456789', 'Just reminding you to attend the Dentist at 3.30pm');

Text takes three arguments, to, message and optionally from.

// If text is already defined as a function in your application you can use
text_message($to, $message, $from); // or
plivo_send_text($to, $message, $from);
sh
php artisan vendor:publish --provider="Midnite81\Plivo\MessagingServiceProvider"