File: /var/www/html/sarvodayahospital/public/kiosk.sarvodayahospital.com/app/SMS.php
<?php
namespace App;
use Illuminate\Http\Client\ConnectionException;
use Illuminate\Support\Facades\Http;
class SMS
{
public function sendOTP($OTP, $mobileNumber)
{
$message = urlencode($OTP.' is your One Time Password to login into your Sarvodaya Healthcare account. Please do not share your OTP with anyone. Thank You');
try {
$smsURL = 'http://nimbusit.co.in/api/swsendSingle.asp?username=t1sarvodayahospitalapi&password=Rabrakha2023&sender=SRVDYA&sendto='.$mobileNumber.'&entityID=1701158056165732117&templateID=1507166866175416818&message='.$message;
info($smsURL);
$response = Http::get($smsURL);
info($response);
return $response->ok();
} catch (ConnectionException $exception) {
return 'Connection not established';
}
}
}