1. Go to this page and download the library: Download renderbit/laravel-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/ */
use Sms;
Sms::send('+919999999999', 'Hello, your OTP is 123456');
use Renderbit\Sms\SmsClient;
class NotificationService
{
public function __construct(protected SmsClient $sms) {}
public function notify($phone, $message)
{
$this->sms->send($phone, $message);
}
}
$success = Sms::send($phoneNumber, $message);
if (!$success) {
// Log failure or retry
}