2017 © Pedro Peláez
 

library sms

A PHP Library built for making SMS sending easier.

image

ridvanbaluyos/sms

A PHP Library built for making SMS sending easier.

  • Tuesday, September 26, 2017
  • by ridvanbaluyos
  • Repository
  • 1 Watchers
  • 1 Stars
  • 4 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 8 Versions
  • 0 % Grown

The README.md

ridvanbaluyos/sms

An SMS Provider Library for PHP, (*1)

Actively Maintained Latest Stable Version Total Downloads Scrutinizer Code Quality Build Status Codacy Badge License, (*2)

Installation

Open your composer.json file and add the following to the require key:, (*3)

"ridvanbaluyos/sms": "v0.6-alpha"

After adding the key, run composer update from the command line to install the package, (*4)

composer update

Or simply add:, (*5)

composer require ridvanbaluyos/sms

Make sure you register for an account and load up your balance., (*6)

Configuration

  1. Go to src/ridvanbaluyos/sms/config folder.
  2. Rename default.providers.json to providers.json.
  3. Fill-up the necessary fields. You need not fill up all providers, only those that you are using.
  "Semaphore" : {
    "url" : "http://api.semaphore.co/api/sms",
    "from" : "Justin Bieber",
    "api" : "1$1++0074+3n0w+0$4ychUR1-cHUr1'x"
  },
  1. In the same folder, open distributions.json and fill up the weights. The total value should be 1.0.
{
  "PromoTexter" : "0.5",
  "Semaphore" : "",
  "RisingTide" : "0.5",
  "Chikka" : ""
}

Usage

Sending SMS with Provider

use ridvanbaluyos\sms\Sms as Sms;
use ridvanbaluyos\sms\providers\PromoTexter as PromoTexter;

$message = 'this is a test message';
$phoneNumber = '639123456789';

$provider = new PromoTexter();
$sms = new Sms($provider);
$sms->send($phoneNumber, $message);

Sending SMS with No Provider

use ridvanbaluyos\sms\Sms as Sms;

$message = 'this is a test message';
$phoneNumber = '639123456789';

$sms = new Sms();
$sms->send($phoneNumber, $message);

When no SMS provider is specified, it will be randomized based on the weights that you defined in the distribution.json file (eg. 0.25 is 25% chance)., (*7)

Account Balance

use ridvanbaluyos\sms\Sms as Sms;

$provider = new PromoTexter();
$sms = new Sms($provider);
$sms->balance();

Supported SMS Providers

  1. Semaphore
  2. PromoTexter
  3. RisingTide
  4. Chikka
  5. Nexmo
  6. Twilio

To Follow

  1. More SMS Providers!

The Versions

26/09 2017

dev-master

9999999-dev

A PHP Library built for making SMS sending easier.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Ridvan Baluyos

api php library sms nexmo twilio chikka

20/12 2016

v0.6-alpha

0.6.0.0-alpha

A PHP Library built for making SMS sending easier.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Ridvan Baluyos

api php library sms nexmo twilio chikka

16/12 2016

v0.5-alpha

0.5.0.0-alpha

A PHP Library built for making SMS sending easier.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Ridvan Baluyos

api php library sms nexmo twilio chikka

12/12 2016

v0.4-alpha

0.4.0.0-alpha

A PHP Library built for making SMS sending easier.

  Sources   Download

MIT

The Requires

 

by Ridvan Baluyos

api php sms php library sms library

12/12 2016

v0.3-alpha

0.3.0.0-alpha

A PHP Library built for making SMS sending easier.

  Sources   Download

MIT

The Requires

 

by Ridvan Baluyos

api php sms php library sms library

08/12 2016

v0.2-alpha

0.2.0.0-alpha

A PHP Library built for making SMS sending easier.

  Sources   Download

MIT

The Requires

 

by Ridvan Baluyos

api php sms php library sms library

08/12 2016

v0.1-alpha

0.1.0.0-alpha

A PHP Library built for making SMS sending easier.

  Sources   Download

MIT

The Requires

 

by Ridvan Baluyos

api php sms php library sms library

08/12 2016

0

0.0.0.0

A PHP Library built for making SMS sending easier.

  Sources   Download

MIT

The Requires

 

by Ridvan Baluyos

api sms