PHP code example of khalidsheet / oursms

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

    

khalidsheet / oursms example snippets


use Khalidsheet\Oursms\Oursms

$oursmsClient = new Oursms();

$oursmsClient->sendMessage(string $to, string $message);

$oursmsClient->sendOtp(string $to, string $otp);

$oursmsClient->getSmsStatus(string $messageId);

use Khalidsheet\Oursms\Traits\Messageable;

class User extends Model {
     use Messageable;

     ...
}

$user = User::find(1);

// Sending OSM 
$user->sendMessage(string $message);

// Sending OTP
$user->sendOtp(string $otp);
bash
  php artisan vendor:publish --provider="Khalidsheet\Oursms\OursmsServiceProvider" --tag="config"