1. Go to this page and download the library: Download mimisk13/laravel-easysms 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/ */
mimisk13 / laravel-easysms example snippets
use Mimisk13\LaravelEasySMS\Facades\EasySMS;
$smsResult = EasySMS::send('+1234567890', 'This is an SMS message');
if ($smsResult) {
echo "SMS sent successfully!";
} else {
echo "Failed to send SMS.";
}
use Mimisk13\LaravelEasySMS\Facades\EasySMS;
$viberResult = EasySMS::send('+1234567890', 'This is a Viber message', 'viber');
if ($viberResult) {
echo "Viber message sent successfully!";
} else {
echo "Failed to send Viber message.";
}
use Mimisk13\LaravelEasySMS\Facades\EasySMS;
$balance = EasySMS::getBalance();
if ($balance && $balance['status'] == 1) {
echo "Current balance: " . $balance['amount'];
} else {
echo "Failed to retrieve balance.";
}