Send SMS with kavenegar RESTFUL Api
Via Composer
$ composer require shetabit/kavenegarsms
Publish config file
php artisan vendor:publish
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']);
}
$ composer test
- [Hashem Moghaddari][link-author]
Shetabit. Please see the license file for more information.