Skip to content

shetabit/kavenegarsms

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

KavenegarSms

Send SMS with kavenegar RESTFUL Api

Installation

Via Composer

$ composer require shetabit/kavenegarsms

Publish config file

php artisan vendor:publish

Usage

Send custom message:

 $mobile = '0911*******';
 $message = 'test message';
 
 $sms = new KavenegarSms;
 $result = $sms->send($mobile, $message);
 if($result['success']) {
    //Send successfully
 } else {
    //Send failed!
    dd($result['message']);
 }

Send lookup message:

 $mobile = '0911*******';
 $token1 = rand(1111, 9999);
 $token2 = '';
 $token3 = '';
 $template = 'verify';
 
 $sms = new KavenegarSms;
 $result = $sms->lookup($mobile, $token1, $token2, $token3, $template);
 if($result['success']) {
    //Send successfully
 } else {
    //Send failed!
    dd($result['message']);
 }

Testing

$ composer test

Credits

  • [Hashem Moghaddari][link-author]

License

Shetabit. Please see the license file for more information.