PHP code example of secrethash / smsg

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

    

secrethash / smsg example snippets


SMSG::showbal('msg91'); // outputs balance for MSG91.com



namespace App\Http\Controllers;


use App\Http\Controllers\Controller;

use Request;

use SMSG;


class SmsgDemoController extends Controller
{
	// Some Code
		# More Code
			$mobile = '1234567890';
			$sender = 'SMSG';
			$msg = 'Hey, John Doe! Your Verification Code is: 7cx50S';
			$provider = 'msg91';
			$route = '4';
			// Will also catch the output
			$trigger = SMSG::send($mobile, $sender, $msg, $provider, $route);
 echo $trigger;
 }



namespace App\Http\Controllers;


use App\Http\Controllers\Controller;

use Request;

use SMSG;


class SmsgDemoController extends Controller
{
	$trigger = SMSG::showbal('msg91', '4', 'XYZ_API_KEY');
	 echo $trigger; 
	 // Outputs the balance of Transaction route of user with API XYZ_API_KEY on MSG91.com
 }