1. Go to this page and download the library: Download androidneha/laravel-msg91 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/ */
$result = Msg91::otp('919999999999');
$result = Msg91::otp('919999999999', 'TEST12');
$result = Msg91::otp('919999999999', 'TEST12', '##OTP## is your OTP, Please dont share it with anyone.');
$result = Msg91::verify('919999999999', 1290); // returns true or false
/**
* @param mixed $notifiable
* @return array
*/
public function via($notifiable)
{
return ['msg91'];
}
use Laravel\Msg91\Message\Msg91Message;
public function toMsg91()
{
return (new Msg91Message)
->message(__('This is just a test message.'))
->sender('MESG91') // [Optional] - Will pick default sender ID from MSG91_DEFAULT_SENDER or config
->transactional(); // or promotional() [Optional] - Will pick default route from MSG91_DEFAULT_ROUTE or config
}
public function routeNotificationForMsg91($notification)
{
return $this->phone_number;
}
$notifiable = /* some class */
$notifiable->notify(new App\Notifications\Msg91TestNotification());
use Illuminate\Support\Facades\Notification
Notification::route('msg91', '919876543210')
->notify(new App\Notifications\Msg91TestNotification());