2017 © Pedro Peláez
 

library plivo

A Plivo SMS integration for Laravel

image

midnite81/plivo

A Plivo SMS integration for Laravel

  • Sunday, December 24, 2017
  • by midnite81
  • Repository
  • 1 Watchers
  • 2 Stars
  • 597 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 13 Versions
  • 4 % Grown

The README.md

Plivo

Latest Stable Version Total Downloads Latest Unstable Version License
A Plivo SMS integration for Laravel, (*1)

Project is archived

Since producing this package, Plivo have updated their own API package which is comprehensive. As such I've decided to archive this project as I am not doing any current development on it., (*2)

Installation

This package requires PHP 5.6+, and includes a Laravel 5 Service Provider and Facade., (*3)

To install through composer include the package in your composer.json., (*4)

"midnite81/plivo": "0.1.*"

Run composer install or composer update to download the dependencies or you can run composer require midnite81/plivo., (*5)

Refresh Autoloader

At this point some users may need to run the command composer dump-autoload. Alternatively, you can run php artisan optimize which should include the dump-autoload command., (*6)

Laravel 5 Integration

To use the package with Laravel 5 firstly add the Messaging service provider to the list of service providers in app/config/app.php., (*7)

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

Add the Messaging facade to your aliases array., (*8)

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

Publish the config and migration files using, (*9)

php artisan vendor:publish --provider="Midnite81\Plivo\MessagingServiceProvider"

To access Plivo/Messaging you can either use the Facade or the Messaging instance is bound to the IOC container and you can then dependency inject it via its contract., (*10)

Messaging::get('foo');

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

Configuration File

Once you have published the config files, you will find a Plivo.php file in the config folder. You should look through these settings and update these where necessary., (*11)

Env

You will need to add the following to your .env file and update these with your own settings, (*12)

PLIVO_AUTH_ID=<auth_id>
PLIVO_AUTH_TOKEN=<auth_token>
PLIVO_SOURCE_NUMBER=<default_sms_number>

Example Usage

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);

The Versions

24/12 2017

dev-master

9999999-dev

A Plivo SMS integration for Laravel

  Sources   Download

MIT

The Requires

 

by Simon Rogers

laravel sms

24/12 2017

v0.1.10

0.1.10.0

A Plivo SMS integration for Laravel

  Sources   Download

MIT

The Requires

 

by Simon Rogers

laravel sms

27/09 2017

v0.1.9

0.1.9.0

A Plivo SMS integration for Laravel

  Sources   Download

MIT

The Requires

 

by Simon Rogers

laravel sms

25/09 2017

v0.1.8

0.1.8.0

A Plivo SMS integration for Laravel

  Sources   Download

MIT

The Requires

 

by Simon Rogers

laravel sms

24/09 2017

v0.1.7

0.1.7.0

A Plivo SMS integration for Laravel

  Sources   Download

MIT

The Requires

 

by Simon Rogers

laravel sms

19/12 2016

dev-develop

dev-develop

A Plivo SMS integration for Laravel

  Sources   Download

MIT

The Requires

 

by Simon Rogers

laravel sms

19/12 2016

v0.1.6

0.1.6.0

A Plivo SMS integration for Laravel

  Sources   Download

MIT

The Requires

 

by Simon Rogers

laravel sms

17/06 2016

v0.1.5

0.1.5.0

A Plivo SMS integration for Laravel

  Sources   Download

MIT

The Requires

 

by Simon Rogers

laravel sms

15/06 2016

0.1.4

0.1.4.0

A Plivo SMS integration for Laravel

  Sources   Download

MIT

The Requires

 

by Simon Rogers

laravel sms

25/04 2016

0.1.3

0.1.3.0

A Plivo SMS integration for Laravel

  Sources   Download

MIT

The Requires

 

by Simon Rogers

laravel sms

18/04 2016

0.1.2

0.1.2.0

A Plivo SMS integration for Laravel

  Sources   Download

MIT

The Requires

 

by Simon Rogers

laravel sms

18/04 2016

0.1.1

0.1.1.0

A Plivo SMS integration for Laravel

  Sources   Download

MIT

The Requires

 

by Simon Rogers

laravel sms

16/04 2016

0.1

0.1.0.0

A Plivo SMS integration for Laravel

  Sources   Download

MIT

The Requires

 

by Simon Rogers

laravel sms