PHP code example of alikhalaj / sms

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

    

alikhalaj / sms example snippets


use Leenset\Sms\Sms;

// ارسال پیامک ساده
Sms::send('متن پیامک', '09123456789');

// ارسال کد OTP
Sms::OTP('123456', '09123456789');

// ارسال کد تأیید (برای SMS.ir)
Sms::verificationCode('123456', '09123456789');

use Leenset\Sms\SmsResolver;

$sms = new SmsResolver();
$sms->make('kavenegar')->send('متن پیامک', '09123456789');

// استفاده از درگاه خاص
Sms::make('kavenegar')->send('متن پیامک', '09123456789');
Sms::make('rayansms')->OTP('123456', '09123456789');
bash
php artisan vendor:publish --provider="Leenset\Sms\SmsServiceProvider8" --tag="config"