PHP code example of zerkxubas / sparrow-sms-laravel

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

    

zerkxubas / sparrow-sms-laravel example snippets


// use the namespace
use Zerkxubas\SparrowSmsLaravel\Facades\SparrowSms;
 
$response = SparrowSms::send($receiver, $message);


// use the namespace
use Zerkxubas\SparrowSmsLaravel\Facades\SparrowSms;

$response = SparrowSms::getCreditBalance();

/*
* Usages
*/

// $response->credits_available
// $response->credits_consumed;
// $response->last_balance_added;
// $response->minimum_credit;
// $response->response_code;


// use the namespace
use Zerkxubas\SparrowSmsLaravel\Facades\SparrowSms;

$creditStatus = SparrowSms::hasCreditBalance();

if ($creditStatus) {
    // Send the OTP or SMS.
}

php artisan vendor:publish --tag=sparrow-sms