1. Go to this page and download the library: Download varaai/varasms 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/ */
varaai / varasms example snippets
use VaraSMS\Laravel\Facades\VaraSMS;
// Basic usage
$response = VaraSMS::sendSMS('255738234345', 'Hello World!');
// With custom sender ID and reference
$response = VaraSMS::sendSMS(
'255738234345',
'Hello World!',
'MYSENDER',
'ref123'
);
use VaraSMS\Laravel\Facades\VaraSMS;
class YourTest extends TestCase
{
public function test_sends_sms()
{
VaraSMS::shouldReceive('sendSMS')
->once()
->with('255738234345', 'Test message')
->andReturn([
'success' => true,
'message' => 'Message sent successfully'
]);
// Your test code here
}
}