Skip to content

This package help you to call api of sms providers in iran with laravel framework

License

Notifications You must be signed in to change notification settings

nishtman1366/laravel-sms

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 

Repository files navigation

nishtman/laravel-sms

This library helps developers to easily call the web services of sms providers in Iran using the Larval Framework.

Supported providers

Installation

Requirements:

  • php >= 7.0
  • laravel >= 5.0

Run the Composer update command

$ composer require nishtman/sms
  • First, enter the settings for your short message provider in the config/sms.php file and enter the module name you want in the default section.

Usage

Sending sms

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');
}

Selecting provider

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');
}

Methods and api

/*
* 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'
* )
*/

Test

Pull requests

License

About

This package help you to call api of sms providers in iran with laravel framework

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages