Skip to content

Latest commit

 

History

History
56 lines (51 loc) · 1.46 KB

README.md

File metadata and controls

56 lines (51 loc) · 1.46 KB

Binary SMS Gateway

Binary SMS is a package for BinarySMS Gateway Service

Installation

Run this command

composer require binarycaster/binarysms

Laravel

If you are using Laravel < 5.5 add provider class manually in config/app

Binarycaster\Binarysms\ServiceProviders\BinarysmsServiceProvider::class,

For facade support add alias

'Binarysms' => Binarycaster\Binarysms\Facades\BinarysmsManager::class,

Publish config file using this command

php artisan vendor:publish --provider="Binarycaster\Binarysms\ServiceProviders\BinarysmsServiceProvider"

Lumen

Create a new config file config/binarysms.php and load configurations in bootstrap/app.php

$app->configure('binarysms');

Register Service Provider class by adding this line in register section

$app->register(Binarycaster\Binarysms\ServiceProviders\BinarysmsServiceProvider::class);

Configuration

Required configs are:

  • app-key => Generated App Key from the Binarysms Admin Panel,
  • app-secret => Generated App Key from the Binarysms Admin Panel,
  • default-sender-id => Check Binarysms Admin Panel,

Usage

In PHP

$binarySms = new Binarysms([]);

$binarySms->to(['01xxxxxxxxx'])
    ->text('Hello World')
    ->send();

In Laravel

Binarysms::to('01xxxxxxxxx')->text('Hello World!')->send();

In Lumen

use Binarycaster\Binarysms\Facades\BinarysmsManager;

BinarysmsManager::to('01xxxxxxxxx')->text('Hello World!')->send();