PHPackages                             nexmo/laravel-notification - 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. nexmo/laravel-notification

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

nexmo/laravel-notification
==========================

Send SMS, WhatsApp, Viber and Facebook Messenger messages via Nexmo

0.2.1(7y ago)512.7k9[3 issues](https://github.com/Nexmo/laravel-notification/issues)MITPHP

Since Nov 26Pushed 5y ago15 watchersCompare

[ Source](https://github.com/Nexmo/laravel-notification)[ Packagist](https://packagist.org/packages/nexmo/laravel-notification)[ RSS](/packages/nexmo-laravel-notification/feed)WikiDiscussions main Synced 2mo ago

READMEChangelog (3)Dependencies (2)Versions (4)Used By (0)

Nexmo / Laravel Notifications
=============================

[](#nexmo--laravel-notifications)

[![Nexmo is now known as Vonage](https://camo.githubusercontent.com/ccd17f652c73446c29e6b56a04f6b5c66ad6aaa85abd041db374e5d2a6b55d3f/68747470733a2f2f646576656c6f7065722e6e65786d6f2e636f6d2f6173736574732f696d616765732f566f6e6167655f4e65786d6f2e737667)](https://camo.githubusercontent.com/ccd17f652c73446c29e6b56a04f6b5c66ad6aaa85abd041db374e5d2a6b55d3f/68747470733a2f2f646576656c6f7065722e6e65786d6f2e636f6d2f6173736574732f696d616765732f566f6e6167655f4e65786d6f2e737667)

Although Nexmo is [available in Laravel](https://laravel.com/docs/5.8/notifications#sms-notifications) as the default SMS provider, the next generation of Nexmo APIs will offer more communication channels. This package adds the ability to send notifications to WhatsApp, Facebook Messenger and Viber via Nexmo.

*Note that the [Messages API](https://developer.nexmo.com/messages/overview) that this package uses has not yet had its stable release so both the API and this library are subject to change*

Usage
-----

[](#usage)

To use this package, run `composer require nexmo/laravel-notification`. Once it completes, you can implement the following methods on your notification:

- `toNexmoWhatsApp`
- `toNexmoFacebook`
- `toNexmoViberServiceMessage`
- `toNexmoSms`

See [examples/Notification/MerryChristmas.php](examples/Notification/MerryChristmas.php) for a complete example.

To send a notification, specify the channel you'd like to use:

```
// To a user
$user->notify(new \App\Notifications\MerryChristmas());

// To any person
Notification::route(
    'nexmo-whatsapp',
    'YOUR_NUMBER'
)->notify(new \App\Notifications\MerryChristmas());
```

The available channels are:

- `nexmo-sms`
- `nexmo-whatsapp`
- `nexmo-facebook`
- `nexmo-viber_service_msg`

As each notification receives a `$notifiable` (usually a user) it can decide how best to route the information. In this case, it checks the `via_whatsapp` property on the user and sends via WhatsApp if it's true. Otherwise it falls back to email

```
public function via($notifiable)
{
    return $notifiable->via_whatsapp ? ['nexmo-whatsapp'] : ['mail'];
}

```

### Message Types

[](#message-types)

Nexmo supports multiple message types, depending on the channel that you're sending to. The `Text` type is the safest if you want to deliver to all channels:

```
public function toNexmoWhatsApp($notifiable)
{
    return (new \Nexmo\Notifications\Message\Text)
        ->content('This is a message being sent to WhatsApp');
}

```

### Caveats

[](#caveats)

For some channels you need to send a templated message before you can send a free text message due to spam control rules. Here's an example of how to use a preapproved template intended for two-factor authentication purposes:

```
public function toNexmoWhatsApp($notifiable)
{
    return (new \Nexmo\Notifications\Message\Template)
        ->name("whatsapp:hsm:technology:nexmo:verify")
        ->parameters([
            ["default" => "Your Brand"],
            ["default" => "64873"],
            ["default" => "10"],
        ]);
}

```

If the recipient replies to your message, you can send them `Text` type messages without any issues

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

[](#configuration)

### Authentication

[](#authentication)

This notifications package is built on top of [nexmo/laravel](https://github.com/Nexmo/nexmo-laravel) and uses the Nexmo client from there.

For this to work, you need to set your application ID and path to your private key in the `.env` file:

```
NEXMO_APPLICATION_ID=my_application_id
NEXMO_PRIVATE_KEY=./private.key

```

### Setting the `from` address

[](#setting-the-from-address)

You can set a `from `address via the `.env` file. This package will look for provider specific entries before falling back to `NEXMO_FROM`.

```
NEXMO_FROM_SMS=""
NEXMO_FROM_WHATSAPP=""
NEXMO_FROM_MESSENGER=""
NEXMO_FROM_VIBER_SERVICE_MSG=""
NEXMO_FROM="" # This is the default if any of the above aren't set

```

Alternatively, you can set a `from` address for a single notification by calling the `->from()` method on a message:

```
public function toNexmoViberServiceMessage($notifiable)
{
    return (new Text)->content('Merry Christmas Viber!')->from("YOUR_ID");
}
```

###  Health Score

33

—

LowBetter than 74% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity30

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 83.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~8 days

Total

3

Last Release

2705d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8c2583b67d4e1a4ade23b6ce271980d18bf3facb4ea3f0610fded770f380d17d?d=identicon)[dragonmantank](/maintainers/dragonmantank)

![](https://www.gravatar.com/avatar/c884ab9b0a394caf7e146cc1b24d7b210e7534d90f45703ce4d4065f24ca53b8?d=identicon)[Vonage](/maintainers/Vonage)

![](https://www.gravatar.com/avatar/efc1f4119b02a988612122f19b2e021c8e919e5018f645d453a62b47064790b2?d=identicon)[SecondeJK](/maintainers/SecondeJK)

---

Top Contributors

[![mheap](https://avatars.githubusercontent.com/u/59130?v=4)](https://github.com/mheap "mheap (5 commits)")[![lornajane](https://avatars.githubusercontent.com/u/172607?v=4)](https://github.com/lornajane "lornajane (1 commits)")

---

Tags

betadeveloper-destinationlaravelnexmonotificationsphpvonage

### Embed Badge

![Health badge](/badges/nexmo-laravel-notification/health.svg)

```
[![Health](https://phpackages.com/badges/nexmo-laravel-notification/health.svg)](https://phpackages.com/packages/nexmo-laravel-notification)
```

###  Alternatives

[laravel-notification-channels/telegram

Telegram Notifications Channel for Laravel

1.1k3.4M35](/packages/laravel-notification-channels-telegram)[s-ichikawa/laravel-sendgrid-driver

This library adds a 'sendgrid' mail driver to Laravel.

4139.3M1](/packages/s-ichikawa-laravel-sendgrid-driver)[laravel-notification-channels/microsoft-teams

A Laravel Notification Channel for Microsoft Teams

1603.0M7](/packages/laravel-notification-channels-microsoft-teams)[laravel-notification-channels/discord

Laravel notification driver for Discord.

2371.3M11](/packages/laravel-notification-channels-discord)[guanguans/notify

Push notification SDK(AnPush、Bark、Chanify、DingTalk、Discord、Gitter、GoogleChat、IGot、Lark、Mattermost、MicrosoftTeams、NowPush、Ntfy、Push、Pushback、PushBullet、PushDeer、PushMe、Pushover、PushPlus、QQ、RocketChat、ServerChan、ShowdocPush、SimplePush、Slack、Telegram、WeWork、WPush、XiZhi、YiFengChuanHua、ZohoCliq、ZohoCliqWebHook、Zulip).

682104.9k7](/packages/guanguans-notify)[tzsk/sms

A robust and unified SMS gateway integration package for Laravel, supporting multiple providers.

320244.3k6](/packages/tzsk-sms)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
