1. Go to this page and download the library: Download arhinful/laravel-mnotify 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/ */
arhinful / laravel-mnotify example snippets
use Arhinful\LaravelMnotify\MNotify;
$notify = new MNotify();
$notify->sendQuickSMS(['0542092800', '0507455860'], 'Hello, this is a quick reminder.');
use Arhinful\LaravelMnotify\MNotify;
$notify = new MNotify('Your Sender Name');
$notify->sendQuickSMS(['0542092800', '0507455860'], 'Hello, this is a quick reminder with a named sender ID.');
$notify = new MNotify();
$notify->sendQuickSMSFromTemplate(['0542092800'], 1); // 1 = template ID in MNotify
// Send to a Group
$notify->sendGroupSMS(['group_id_1', 'group_id_2'], 'Hello Group!');
// Send to a Group from Template
$notify->sendGroupSMSFromTemplate(['group_id_1'], 1);
// Register a Sender ID
$notify->registerSenderId('MyBrand', 'For OTP verification');
// Check Sender ID Status
$notify->checkSenderIdStatus('MyBrand');
// Get SMS Delivery Report
$notify->getSMSDeliveryReport('campaign_id');
// Get Specific SMS Report
$notify->getSpecificSMSDeliveryReport('message_id');
// Get Periodic SMS Report
$notify->getPeriodicSMSDeliveryReport('2023-01-01', '2023-01-31');
// Get Voice Call Report
$notify->getVoiceCallReport('campaign_id');
use Illuminate\Notifications\Notification;
use Arhinful\LaravelMnotify\NotificationDriver\MNotifyChannel;
use Arhinful\LaravelMnotify\NotificationDriver\MNotifyMessage;
class TestNotification extends Notification
{
public function via($notifiable)
{
return [MNotifyChannel::class];
}
public function toMNotify($notifiable)
{
return (new MNotifyMessage())
->message("Hello {$notifiable->name}, your appointment is tomorrow.");
}
}
public function routeNotificationForMNotify(): string
{
return $this->mobile; // column containing the phone number
}