arhinful/laravel-mnotify

Laravel package for MNotify SMS and voice notifications

Installs: 523

Dependents: 0

Suggesters: 0

Security: 0

Stars: 5

Watchers: 1

Forks: 0

Open Issues: 1

pkg:composer/arhinful/laravel-mnotify

v2.0.0 2025-11-20 09:30 UTC

This package is auto-updated.

Last update: 2025-12-21 04:38:18 UTC


README

Latest Stable Version Total Downloads License

A Laravel package that provides a clean, expressive API for sending SMS and voice call notifications via the MNotify platform.

Features

  • Simple, chainable API for quick SMS, templated SMS and voice calls.
  • Full Laravel Notification channel integration.
  • Publishable configuration file.
  • Supports Laravel 8, 9, 10, 11, and 12.
  • No external dependencies – uses Guzzle under the hood.

Why Laravel MNotify?

  • Clean & fluent API that feels like native Laravel.
  • Complete coverage of all major MNotify features.
  • Seamless integration with Laravel’s Notification system.
  • Zero configuration required (auto-discovery).
  • Actively maintained and now updated for Laravel 8 → 12.

Requirements

  • PHP 8.0+
  • Laravel 8 – 12
  • A valid MNotify API key
  • Mnotify Sender name

Installation

composer require arhinful/laravel-mnotify

The package will be auto‑discovered. If you need to publish the config file:

php artisan vendor:publish --provider="Arhinful\\LaravelMnotify\\MNotifyServiceProvider"

Configuration

Add the following keys to your .env file:

MNOTIFY_KEY=your_api_key_here
MNOTIFY_SENDER_ID="Your Sender Name"

The values must match those configured in your MNotify dashboard.

Usage

📱 SMS Notifications

Quick SMS

use Arhinful\LaravelMnotify\MNotify;

$notify = new MNotify();
$notify->sendQuickSMS(['0542092800', '0507455860'], 'Hello, this is a quick reminder.');

SMS from Template

$notify = new MNotify();
$notify->sendQuickSMSFromTemplate(['0542092800'], 1); // 1 = template ID in MNotify

Group Bulk SMS

// 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);

Scheduled SMS

// Send a Scheduled SMS
$notify->setIsSchedule(true)
       ->setScheduleDate('2023-12-25 08:00:00')
       ->sendQuickSMS(['054xxxxxxx'], 'Merry Christmas!');

// Get Scheduled SMS
$notify->getScheduledSMS();

// Update Scheduled SMS
$notify->updateScheduledSMS(123, 'New message content', '2023-12-25 09:00:00');

📞 Voice Calls & IVR

Voice Calls

// Quick Bulk Voice Call (using audio file)
$notify->sendQuickVoiceCall('Campaign Title', ['054xxxxxxx'], '/path/to/audio.mp3');

// Quick Bulk Voice Call (using Voice ID)
$notify->sendQuickVoiceCallFromTemplate('Campaign Title', ['054xxxxxxx'], 'voice_id_123');

// Group Bulk Voice Call (using audio file)
$notify->sendGroupVoiceCall('Campaign Title', ['group_id_1'], '/path/to/audio.mp3');

// Group Bulk Voice Call (using Voice ID)
$notify->sendGroupVoiceCallFromTemplate('Campaign Title', ['group_id_1'], 'voice_id_123');

// Scheduled Voice Call (works with all above methods)
$notify->setIsSchedule(true)
       ->setScheduleDate('2023-12-25 08:00:00')
       ->sendQuickVoiceCall('Campaign Title', ['054xxxxxxx'], '/path/to/audio.mp3');

IVR

// Initiate IVR Call
$notify->initiateIVRCall(['054xxxxxxx'], 'audio_file_id_or_path');

// Get IVR Scenarios
$notify->getIVRScenarios();

// Launch IVR Scenario
$notify->launchIVRScenario(123, ['054xxxxxxx']);

📊 Account & Reports

Balance Check

// Check SMS Balance
$notify->checkSMSBalance();

// Check Voice Balance
$notify->checkVoiceBalance();

Sender ID

// Register a Sender ID
$notify->registerSenderId('MyBrand', 'For OTP verification');

// Check Sender ID Status
$notify->checkSenderIdStatus('MyBrand');

Reports

// 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');

🔔 Laravel Notification Channel

Use the MNotifyChannel to send notifications via Laravel's built-in system.

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.");
    }
}

In your model, define the phone number accessor:

public function routeNotificationForMNotify(): string
{
    return $this->mobile; // column containing the phone number
}

Testing

vendor/bin/phpunit

Contributing

Feel free to open issues or submit pull requests. Please follow the PSR‑12 coding style.

License

This package is open‑source software licensed under the MIT License.