PHPackages                             craftsys/msg91-laravel-notification-channel - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Mail &amp; Notifications](/categories/mail)
4. /
5. craftsys/msg91-laravel-notification-channel

ActiveLibrary[Mail &amp; Notifications](/categories/mail)

craftsys/msg91-laravel-notification-channel
===========================================

Laravel notification channel for MSG91 apis.

v0.7.2(1y ago)551.9k↓25.6%4[1 PRs](https://github.com/craftsys/msg91-laravel-notification-channel/pulls)MITPHPPHP ^7.1.3|^8.0|^8.1|^8.2CI failing

Since Oct 21Pushed 1y ago1 watchersCompare

[ Source](https://github.com/craftsys/msg91-laravel-notification-channel)[ Packagist](https://packagist.org/packages/craftsys/msg91-laravel-notification-channel)[ Docs](https://github.com/craftsys/msg91-laravel-notification-channel)[ RSS](/packages/craftsys-msg91-laravel-notification-channel/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (4)Versions (25)Used By (0)

Laravel Notification Channels For Msg91 SMS Notifications
=========================================================

[](#laravel-notification-channels-for-msg91-sms-notifications)

[![Total Downloads](https://camo.githubusercontent.com/ad1febe6efc323b09b5832c70661b70252e9e04f3c301228d9c2b2cbf156febd/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f63726166747379732f6d736739312d6c61726176656c2d6e6f74696669636174696f6e2d6368616e6e656c)](https://packagist.org/packages/craftsys/msg91-laravel-notification-channel)[![Latest Stable Version](https://camo.githubusercontent.com/9b465873a90bd1339af4fc64bad7d93aa3c46e1e1fbbb56e52cdb53d94c8162b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f63726166747379732f6d736739312d6c61726176656c2d6e6f74696669636174696f6e2d6368616e6e656c3f6c6162656c3d76657273696f6e)](https://packagist.org/packages/craftsys/msg91-laravel-notification-channel)[![License](https://camo.githubusercontent.com/b6139d584b21755a6dd7e92937fcffddb969acc90e8ccf047d22d190ea9238ff/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f63726166747379732f6d736739312d6c61726176656c2d6e6f74696669636174696f6e2d6368616e6e656c)](https://packagist.org/packages/craftsys/msg91-laravel-notification-channel)[![Status](https://github.com/craftsys/msg91-laravel-notification-channel/actions/workflows/tests.yml/badge.svg)](https://github.com/craftsys/msg91-laravel-notification-channel/actions/workflows/tests.yml)

Laravel notification channel for Msg91 API (wrapper around [Laravel Msg91 Client](https://github.com/craftsys/msg91-laravel))

Table of Contents
-----------------

[](#table-of-contents)

- [Installation](#installation)
- [Configuration](#configuration)
- [Usage](#usage)
    - [SMS](#sms)
    - [OTP](#otp)
    - [Verify OTP](#verify-otp)
    - [Routing SMS Notifications](#routing-sms-notifications)
    - [Advanced Usage](#advanced-usage)
- [Related](#related)
- [Acknowledgements](#acknowledgements)

Installation
------------

[](#installation)

**prerequisite**

- php^7.1
- laravel^5|^6|^7|^8|^9|^10

The package is tested for 5.8+,^6.0,^7.0,^8.0,^9.0,^10.0 only. If you find any bugs for laravel (5.0&lt; &gt;5.8), please file an issue.

```
composer require craftsys/msg91-laravel-notification-channel
```

> If you just want to integrate Msg91 api in Laravel without notification channel, please use [Msg91 Laravel](https://github.com/craftsys/msg91-laravel) instead.

Configuration
-------------

[](#configuration)

Next, you will need to add a few configuration options to your `config/services.php` configuration file. You may copy the example configuration below to get started:

```
// along with other services
'msg91' => [
    'key' => env("MSG91_KEY")
]
```

All available configuration can be found at [msg91-php client's configuration page](https://github.com/craftsys/msg91-php#configuration)

Usage
-----

[](#usage)

If a notification supports being sent as an SMS, you should define a `toMsg91` method on the notification class. This method will receive a `$notifiable` entity and should return a `Craftsys\Notifications\Messages\Msg91SMS` or `Craftsys\Notifications\Messages\Msg91OTP` instance based on your need to sending message or sending an OTP.

**NOTE**: Phone number must be in international format i.e. it must include the country code.

```
