PHP code example of parhaaam / sendsms

1. Go to this page and download the library: Download parhaaam/sendsms 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/ */

    

parhaaam / sendsms example snippets


return [

    'default' => 'kavenegar',
    'drivers' => [
        'kavenegar' => [
            'key'  => env('kavenegar_key', ''),
        ],
        'smsir' => [
            'key'    => env('smsir_key', ''),
            'secret' => env('smsir_key', ''),
        ]
    ]
];

// Send Lookup sms
$sendSms = new Parhaaam\SendSms();
$sendSms->sendLookup($receptor = "__phone_number__", $template = "loginVerify", $tokens = ["Test"]);
// will send sms using default sms provider which has been set in config/sendsms.php

// Send Lookup sms with sms.ir
$sendSms = new SendSms();
$sendSms
    ->via('smsir')
    ->sendLookup($receptor = "__phone_number__", $template = "19737", ["token_one_name" => "token_value", "token_two_name" => "token_two_value"]);

bash
php artisan vendor:publish --tag="sendsms-config"