PHP code example of karnoweb / sms-sender

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

    

karnoweb / sms-sender example snippets


use Karnoweb\SmsSender\Facades\Sms;
use Karnoweb\SmsSender\Enums\SmsTemplateEnum;

// Simple message
Sms::message('Hello World')
    ->number('09120000000')
    ->send();

// OTP
Sms::otp(SmsTemplateEnum::LOGIN_OTP)
    ->input('code', '1234')
    ->number('09120000000')
    ->send();

// Multiple recipients
Sms::message('Announcement')
    ->numbers(['09121111111', '09122222222'])
    ->send();

// Check delivery status
$results = Sms::number('09120000000')->checkStatus();
bash
composer vendor:publish --tag=sms-config
php artisan vendor:publish --tag=sms-migrations
php artisan migrate