PHP code example of djunehor / laravel-sms

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

    

djunehor / laravel-sms example snippets


'providers' => [
    // ...
    Djunehor\Sms\SmsServiceProvider::class,
];

// Register Service Providers
    // ...
    $app->register(Djunehor\Sms\SmsServiceProvider::class);
];

//using betaSMS
use Djunehor\Sms\BetaSms;

$sms = new BetaSms();
$sms->text($message)->to(08135087966)->from('MyLaravel')->send();
//returns true if everything went fine. Or false if error occured.
//You can get exception via getException() or get the server response via getResponse()
//exceptions will be logged in your laravel log file

//MeboSms
$send = send_sms($message, $to, $from, MeboSms::class); //returns true/false

$send = send_sms($message, $to);
//$from is optional and is better set in the config