PHP code example of devfaysal / laravel-muthofun-sms

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

    

devfaysal / laravel-muthofun-sms example snippets

 
php artisan vendor:publish --provider="Devfaysal\Muthofun\MuthofunServiceProvider" 
 artisan vendor:publish --provider="Devfaysal\Muthofun\MuthofunServiceProvider" --force 
 
use Devfaysal\Muthofun\Facades\Muthofun; 

Muthofun::send('01717012345' , 'Your Message!!');
//Returns status code. 200 for success

use Devfaysal\Muthofun\Facades\Muthofun; 

$users = [
  '01717012345', 
  '01671012345', 
  '01811012345'
]

Muthofun::send($users , 'Your Message!!');
//Returns status code. 200 for success


use Devfaysal\Muthofun\Facades\Muthofun;

Muthofun::deliveryReport();
//Returns array
[
  [
    "shoot_id" => "R200008462443416b5e06"
    "receiver" => "8801671012345"
    "sender_id" => "8809601000000"
    "operator_name" => "Airtel"
    "sms_type" => "text"
    "sms_length" => 24
    "sms_count" => 1
    "sms_body" => "Testing package from app"
    "sms_rate" => 0.25
    "sms_cost" => 0.25
    "status" => "Delivered"
    "created_at" => "2022-03-30T16:42:28.797410+06:00"
  ],
  [
    "shoot_id" => "R2000084624434169918a"
    "receiver" => "8801717012345"
    "sender_id" => "8809601000000"
    "operator_name" => "GP"
    "sms_type" => "text"
    "sms_length" => 24
    "sms_count" => 1
    "sms_body" => "Testing package from app"
    "sms_rate" => 0.25
    "sms_cost" => 0.25
    "status" => "Delivered"
    "created_at" => "2022-03-30T16:42:28.782344+06:00"
  ]
]

use Devfaysal\Muthofun\Facades\Muthofun; 

//Get only balance
Muthofun::accountBalance();
//Returns balance in BDT
3.5

//Get details balance information
Muthofun::accountBalance(true);
//Returns array
[
  "code" => 200
  "message" => "User balance received successfully!"
  "balance" => 3.5
  "expiry" => "2022-04-28T11:05:21.671640Z"
]