2017 © Pedro Peláez
 

library laravel-sms

Simple SMS Package for laravel

image

isurindu/laravel-sms

Simple SMS Package for laravel

  • Monday, July 30, 2018
  • by isurindu
  • Repository
  • 1 Watchers
  • 1 Stars
  • 4 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

Laravel SMS - simple sms package for laravel

Support Gateways

  • shoutout
  • dialog
  • mobitel (coming soon)

Installation

You can install the package via composer:, (*1)

composer require isurindu/laravel-sms

In Laravel 5.5 the service provider will automatically get registered. In older versions of the framework just add the service provider in config/app.php file:, (*2)

'providers' => [
    // ...
    Isurindu\LaravelSms\LaravelSmsServiceProvider::class,
];

You can publish config, (*3)

php artisan vendor:publish --provider="Isurindu\LaravelSms\LaravelSmsServiceProvider::class"

configaration in config/sms.php, (*4)

return [
    'default_sms_provider'=>env('SMS_PROVIDER', 'dialog'),//dialog,shoutout,log
    'fallback_sms_provider'=>env('SMS_PROVIDER_FALLBACK', ''), //alternative sms provider for an emergency

    'shoutout'=>[
        'api_key'=>env('SHOUTOUT_API_KEY', 'XXXXXXXXX.XXXXXXXXX.XXXXXXXXX'),
        'from'=>env('SHOUTOUT_FROM_NUMBER', 'YOUR_NUMBER_MASK_HERE'),
    ],
    'dialog'=>[
        'username'=>env('DIALOG_USERNAME', ''),
        'password'=>env('DIALOG_PASSWORD', ''),
        'from'=>env('DIALOG_FROM_NUMBER', 'YOUR_NUMBER_MASK_HERE'),
    ],
];

Usage

<?php

use Isurindu\LaravelSms\Facades\Sms;

Sms::to('94702125238')
    ->send('hello world');

Add New SMS Gateway

Sms::provider('mobitel')
    ->to('94702125238')
    ->send('hello world');

if provider is mobitel class name must be located at Gateways\MobitelGateway, (*5)

<?php
namespace Isurindu\LaravelSms\Gateways;

use Isurindu\LaravelSms\Interfaces\SmsInterface;
use Isurindu\LaravelSms\Exceptions\LaravelSmsGatewayException;

class MobitelGateway implements SmsInterface
{
    public function sendSms($to, $msg, $from)
    {
        //send sms logic here
        //if something went wrong  throw new LaravelSmsGatewayException('something went wrong');

    }
}

The Versions

30/07 2018

dev-master

9999999-dev

Simple SMS Package for laravel

  Sources   Download

MIT

The Requires

 

by isurindu prabashwara

30/07 2018

v1.3

1.3.0.0

Simple SMS Package for laravel

  Sources   Download

MIT

The Requires

 

by isurindu prabashwara

30/07 2018

v1.2

1.2.0.0

Simple SMS Package for laravel

  Sources   Download

MIT

The Requires

 

by isurindu prabashwara

30/07 2018

v1.1

1.1.0.0

Simple SMS Package for laravel

  Sources   Download

MIT

The Requires

 

by isurindu prabashwara

10/07 2018

v1.0

1.0.0.0

Simple SMS Package for laravel

  Sources   Download

MIT

The Requires

 

by isurindu prabashwara