Binary SMS is a package for BinarySMS Gateway Service
Run this command
composer require binarycaster/binarysms
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"
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);
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,
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();