PHP code example of shetabit / kavenegarsms

1. Go to this page and download the library: Download shetabit/kavenegarsms library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

shetabit / kavenegarsms example snippets


 $mobile = '0911*******';
 $message = 'test message';
 
 $sms = new KavenegarSms;
 $result = $sms->send($mobile, $message);
 if($result['success']) {
    //Send successfully
 } else {
    //Send failed!
    dd($result['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']);
 }
 bash
php artisan vendor:publish