This package help you to call api of sms providers in iran with laravel framework
nishtman/laravel-sms is a Laravel package for this package help you to call api of sms providers in iran with laravel framework.
It currently has 1 GitHub stars and 1 downloads on Packagist.
Install it with composer require nishtman/laravel-sms.
Discover more Laravel packages by nishtman
or browse all Laravel packages to compare alternatives.
Last updated
This library helps developers to easily call the web services of sms providers in Iran using the Larval Framework.
php >= 7.0laravel >= 5.0Run 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'
* )
*/