PHPackages                             nexmo/laravel - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. nexmo/laravel

Abandoned → vonage-laravelArchivedLibrary[HTTP &amp; Networking](/categories/http)

nexmo/laravel
=============

Laravel Package for Nexmo's PHP Client

3.0.0(4y ago)3133.2M—1.5%789MITPHPPHP ^7.4|^8.0|^8.1

Since Sep 29Pushed 3y ago34 watchersCompare

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

READMEChangelog (10)Dependencies (4)Versions (19)Used By (9)

> THIS PACKAGE IS DEPRECATED We have moved to: , so please raise any new issues or Pull Requests in this repository.

 Nexmo Package for Laravel
---------------------------

[](#----nexmo-package-for-laravel)

 [![Latest Stable Version](https://camo.githubusercontent.com/579c9bc26bd326894ad643054148b88fb012ca7124873358798a1375004f6036/68747470733a2f2f706f7365722e707567782e6f72672f6e65786d6f2f6c61726176656c2f762f737461626c653f666f726d61743d666c61742d737175617265)](https://packagist.org/packages/nexmo/laravel) [![Latest Unstable Version](https://camo.githubusercontent.com/bc818ccb0c8deba07f3869d869de91ad2e646efd934601d3340cd1c0602634fb/68747470733a2f2f706f7365722e707567782e6f72672f6e65786d6f2f6c61726176656c2f762f756e737461626c653f666f726d61743d666c61742d737175617265)](https://packagist.org/packages/nexmo/laravel) [![License](https://camo.githubusercontent.com/c246603bef4b184091e00da345f1a87e591ef3b123edf94be218d6b4cbae0b81/68747470733a2f2f706f7365722e707567782e6f72672f6e65786d6f2f6c61726176656c2f6c6963656e73653f666f726d61743d666c61742d737175617265)](https://packagist.org/packages/nexmo/laravel) [![Total Downloads](https://camo.githubusercontent.com/20970df467b6944f31045f12052dd113720070e3e1821ced10217d418b5a4225/68747470733a2f2f706f7365722e707567782e6f72672f6e65786d6f2f6c61726176656c2f646f776e6c6f616473)](https://packagist.org/packages/nexmo/laravel)

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

Introduction
------------

[](#introduction)

This is a simple Laravel Service Provider providing access to the [Nexmo PHP Client Library](https://github.com/Nexmo/nexmo-php).

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

[](#installation)

To install the PHP client library using Composer:

```
composer require nexmo/laravel
```

Alternatively, add these two lines to your composer require section:

```
{
    "require": {
        "nexmo/laravel": "^2.0"
    }
}
```

### Laravel 5.5+

[](#laravel-55)

If you're using Laravel 5.5 or above, the package will automatically register the `Nexmo` provider and facade.

### Laravel 5.4 and below

[](#laravel-54-and-below)

Add `Nexmo\Laravel\NexmoServiceProvider` to the `providers` array in your `config/app.php`:

```
'providers' => [
    // Other service providers...

    Nexmo\Laravel\NexmoServiceProvider::class,
],
```

If you want to use the facade interface, you can `use` the facade class when needed:

```
use Nexmo\Laravel\Facade\Nexmo;
```

Or add an alias in your `config/app.php`:

```
'aliases' => [
    ...
    'Nexmo' => Nexmo\Laravel\Facade\Nexmo::class,
],
```

### Using Nexmo-Laravel with Lumen

[](#using-nexmo-laravel-with-lumen)

Nexmo-Laravel works with Lumen too! You'll need to do a little work by hand to get it up and running. First, install the package using composer:

```
composer require nexmo/laravel
```

Next, we have to tell Lumen that our library exists. Update `bootstrap/app.php`and register the `NexmoServiceProvider`:

```
$app->register(Nexmo\Laravel\NexmoServiceProvider::class);
```

Finally, we need to configure the library. Unfortunately Lumen doesn't support auto-publishing files so you'll have to create the config file yourself by creating a config directory and copying the config file out of the package in to your project:

```
mkdir config
cp vendor/nexmo/laravel/config/nexmo.php config/nexmo.php
```

At this point, set `NEXMO_KEY` and `NEXMO_SECRET` in your `.env` file and it should be working for you. You can test this with the following route:

```
$router->get('/', function () use ($router) {
    app(Nexmo\Client::class);
});
```

### Dealing with Guzzle Client issues

[](#dealing-with-guzzle-client-issues)

By default, this package uses `nexmo/client`, which includes a Guzzle adapter for accessing the API. Some other libraries supply their own Guzzle adapter, leading to composer not being able to resolve a list of dependencies. You may get an error when adding `nexmo/laravel` to your application because of this.

The Nexmo client allows you to override the HTTP adapter that is being used. This takes a bit more configuration, but this package allows you to use `nexmo/client-core` to supply your own HTTP adapter.

To do this:

1. `composer require nexmo/client-core` to install the Core SDK
2. Install your own `httplug`-compatible adapter. For example, to use Symfony's HTTP Client:

    1. `composer require symfony/http-client php-http/message-factory php-http/httplug nyholm/psr7`
3. `composer require nexmo/laravel` to install this package
4. In your `.env` file, add the following configuration:

    `NEXMO_HTTP_CLIENT="Symfony\\Component\\HttpClient\\HttplugClient"`

You can now pull the `Nexmo\Client` object from the Laravel Service Container, or use the Facade provided by this package.

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

[](#configuration)

You can use `artisan vendor:publish` to copy the distribution configuration file to your app's config directory:

```
php artisan vendor:publish
```

Then update `config/nexmo.php` with your credentials. Alternatively, you can update your `.env` file with the following:

```
NEXMO_KEY=my_api_key
NEXMO_SECRET=my_secret
```

Optionally, you could also set an `application_id` and `private_key` if required:

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

Private keys can either be a path to a file, like above, or the string of the key itself:

```
NEXMO_PRIVATE_KEY="-----BEGIN PRIVATE KEY-----\n[...]\n-----END PRIVATE KEY-----\n"
```

```
NEXMO_PRIVATE_KEY="-----BEGIN PRIVATE KEY-----
[...]
-----END PRIVATE KEY-----
"
```

Usage
-----

[](#usage)

To use the Nexmo Client Library you can use the facade, or request the instance from the service container:

```
Nexmo::message()->send([
    'to'   => '14845551244',
    'from' => '16105552344',
    'text' => 'Using the facade to send a message.'
]);
```

Or

```
$nexmo = app('Nexmo\Client');

$nexmo->message()->send([
    'to'   => '14845551244',
    'from' => '16105552344',
    'text' => 'Using the instance to send a message.'
]);
```

If you're using private key authentication, try making a voice call:

```
Nexmo::calls()->create([
    'to' => [[
        'type' => 'phone',
        'number' => '14155550100'
    ]],
    'from' => [
        'type' => 'phone',
        'number' => '14155550101'
    ],
    'answer_url' => ['https://example.com/webhook/answer'],
    'event_url' => ['https://example.com/webhook/event']
]);
```

For more information on using the Nexmo client library, see the [official client library repository](https://github.com/Nexmo/nexmo-php).

###  Health Score

53

—

FairBetter than 97% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity61

Solid adoption and visibility

Community38

Small or concentrated contributor base

Maturity80

Battle-tested with a long release history

 Bus Factor3

3 contributors hold 50%+ of commits

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 ~121 days

Recently: every ~178 days

Total

17

Last Release

1565d ago

Major Versions

0.4.0 → 1.0.0-beta52017-06-30

1.1.2 → 2.0.02019-09-11

2.4.1 → 3.0.02022-02-03

PHP version history (4 changes)1.0.1PHP &gt;=5.6

2.0.0PHP ^5.6|^7.1

2.4.0PHP ^5.6|^7.1|^8.0

3.0.0PHP ^7.4|^8.0|^8.1

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2683897?v=4)[Vonage](/maintainers/Vonage)[@Vonage](https://github.com/Vonage)

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

---

Top Contributors

[![dragonmantank](https://avatars.githubusercontent.com/u/108948?v=4)](https://github.com/dragonmantank "dragonmantank (16 commits)")[![tjlytle](https://avatars.githubusercontent.com/u/125074?v=4)](https://github.com/tjlytle "tjlytle (9 commits)")[![SecondeJK](https://avatars.githubusercontent.com/u/17067659?v=4)](https://github.com/SecondeJK "SecondeJK (7 commits)")[![mheap](https://avatars.githubusercontent.com/u/59130?v=4)](https://github.com/mheap "mheap (5 commits)")[![driesvints](https://avatars.githubusercontent.com/u/594614?v=4)](https://github.com/driesvints "driesvints (3 commits)")[![percymamedy](https://avatars.githubusercontent.com/u/11259669?v=4)](https://github.com/percymamedy "percymamedy (2 commits)")[![dwightwatson](https://avatars.githubusercontent.com/u/1100408?v=4)](https://github.com/dwightwatson "dwightwatson (2 commits)")[![lornajane](https://avatars.githubusercontent.com/u/172607?v=4)](https://github.com/lornajane "lornajane (2 commits)")[![leggetter](https://avatars.githubusercontent.com/u/328367?v=4)](https://github.com/leggetter "leggetter (1 commits)")[![danielebarbaro](https://avatars.githubusercontent.com/u/4376886?v=4)](https://github.com/danielebarbaro "danielebarbaro (1 commits)")[![elstamey](https://avatars.githubusercontent.com/u/4660760?v=4)](https://github.com/elstamey "elstamey (1 commits)")[![afolson](https://avatars.githubusercontent.com/u/2797769?v=4)](https://github.com/afolson "afolson (1 commits)")[![Omranic](https://avatars.githubusercontent.com/u/406705?v=4)](https://github.com/Omranic "Omranic (1 commits)")

---

Tags

developer-destinationlaravellaravel-packagelaravel-service-providerlibrarysmstelephonyvonage

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[danharrin/livewire-rate-limiting

Apply rate limiters to Laravel Livewire actions.

40423.1M27](/packages/danharrin-livewire-rate-limiting)[mateusjunges/laravel-kafka

A kafka driver for laravel

7163.1M17](/packages/mateusjunges-laravel-kafka)[illuminate/http

The Illuminate Http package.

11936.0M5.1k](/packages/illuminate-http)[ricorocks-digital-agency/soap

A SOAP client that provides a clean interface for handling requests and responses.

4281.8M5](/packages/ricorocks-digital-agency-soap)[api-platform/laravel

API Platform support for Laravel

59126.4k6](/packages/api-platform-laravel)[laravel-shift/curl-converter

A command line tool to convert curl requests to Laravel HTTP requests.

935.3k](/packages/laravel-shift-curl-converter)

PHPackages © 2026

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