Downloads
Stars
Version
This library helps developers to easily call the web services of sms providers in Iran using the Larval Framework.
php >= 7.0
laravel >= 5.0
Run the Composer update command
$ composer require nishtman/sms
config/sms.php
file and enter the module name you want in the default
section.public function send()
{
/*
* Instance the sms object
*/
$sms = new \Nishtman\Sms\Sms();
$result = $sms->send('09123456789', 'text message');
/*
* or you can use facades
*/
$result = Nishtman\Sms\Facades\Sms::send('09123456789', 'text message');
}
public function send()
{
/*
* Instance the sms object
*/
$sms = new \Nishtman\Sms\Sms();
$result = $sms->provider('HostIran')->send('09123456789', 'text message')
/*
* or you can use facades
*/
$result = Nishtman\Sms\Facades\Sms::provider('HostIran')->send('09123456789', 'text message');
}
/*
* Set the provider
*/
provider(string $provider): \Nishtman\Sms\sms
/*
* Set sms message
*/
send(string $to, string $text): array
/*
* Array
* (
* [status] => 'integer status code'
* [message] => 'string message'
* [referenceId] => 'integer reference id to get the delivery report'
* )
*/
/*
* Get the delivery status
*/
delivery(int $referenceId): array
/*
* Array
* (
* [string] => 'string status text'
* )
*/
/*
* Get the credits value
*/
getCredits(int $referenceId): int
/*
* Array
* (
* [int] => 'your credit amount'
* )
*/