This is a package for sending SMS for Laravel and PHP built with Plivo. Check it out and have fun!

INSTALLATION

Download package form plivo . Place it in vendor directory of your project. edit composer.json file or Run following command

composer require lakshmajim/plivo

Run follwoing command from the Terminal:

composer dumpautoload

composer update

Laravel INTEGRATION

Add following lines to app/config/app.php.

In providers array
lakshmajim\plivo\PlivoServiceProvider::class,

In aliases array
'Plivo' => lakshmajim\plivo\Facade\Plivo::class,

MISCELLANEOUS

SENDING SMS

<?php
Use Plivo;

//send sms using sendMessagePlivo() method

Plivo::sendMessagePlivo($auth_id,$auth_token);

//setting source mobile number

Plivo::setSourceMobile("918888888888");

//setting destination mobile number

Plivo::setDestinationMobile("919999999999");

//setting text message

Plivo::setMessagePlivo(" is!");

//setting call back url

Plivo::setCallBackUrl("http://localhost/");

This package is used to send sms to any mobile number. This uses Plivo API. It requires AuthId and AuthToken, they can be generated by registrting @at Plivo after registrion click on Dashboard ,there you will be able to see authid and authtoken.

EXAMPLE CODE

Laravel

PlivoController.php

<?php namespace App\Http\Controllers;

use Illuminate\Routing\Controller as BaseController;

use Plivo;

class PlivoController extends BaseController

{

public function sendSMS()

{

$src = Plivo::setSourceMobile("");

$dest = Plivo::setDestinationMobile("");

$txt = Plivo::setMessagePlivo("");

$url = Plivo::setCallBackUrl("");

$smsObject=Plivo::sendMessagePlivo('','');

echo "$smsObject"; //diaplay final message response

}

}