PHPackages                             renatoxm/laravel-vonage-dlr-webhooks - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. renatoxm/laravel-vonage-dlr-webhooks

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

renatoxm/laravel-vonage-dlr-webhooks
====================================

Handle delivery receipt SMS webhooks in Laravel php framework

v2.0.1(2y ago)21.1k—0%MITPHPPHP ^8.1

Since Aug 28Pushed 2y ago1 watchersCompare

[ Source](https://github.com/renatoxm/laravel-vonage-dlr-webhooks)[ Packagist](https://packagist.org/packages/renatoxm/laravel-vonage-dlr-webhooks)[ Docs](https://github.com/renatoxm/laravel-vonage-dlr-webhooks)[ GitHub Sponsors](https://github.com/RenatoXM)[ RSS](/packages/renatoxm-laravel-vonage-dlr-webhooks/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (8)Versions (14)Used By (0)

LaravelVonageDlrWebhooks
========================

[](#laravelvonagedlrwebhooks)

[![Latest Version on Packagist](https://camo.githubusercontent.com/f92fbab4eeba2338897db504201f610b607738a5c18f600c5d1b1d2881500169/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f72656e61746f786d2f6c61726176656c2d766f6e6167652d646c722d776562686f6f6b732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/renatoxm/laravel-vonage-dlr-webhooks)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Tests](https://camo.githubusercontent.com/9a1e0d1e8b5347267d4f5ace0e8879db588b69af9927dade0d21dc8cdc23d5e8/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f72656e61746f786d2f6c61726176656c2d766f6e6167652d646c722d776562686f6f6b732f74657374732e796d6c3f6272616e63683d6d61696e)](https://github.com/renatoxm/laravel-vonage-dlr-webhooks/actions/workflows/tests.yml)[![StyleCI](https://camo.githubusercontent.com/57c18c4c4a90d1dab1bc6cde9c0f81fd96fd34a3116f5a30b894fadda918e5df/68747470733a2f2f7374796c6563692e696f2f7265706f732f3638323935333333322f736869656c643f6272616e63683d6d61696e)](https://styleci.io/repos/682953332)[![Total Downloads](https://camo.githubusercontent.com/ecf4e440b4cffb1c6f2f8fa779d4529f13da1b34441f7c00919f2ad397ebfdcd/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f72656e61746f786d2f6c61726176656c2d766f6e6167652d646c722d776562686f6f6b732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/renatoxm/laravel-vonage-dlr-webhooks)

Handle [Vonage](https://developer.vonage.com/en/messaging/sms/guides/delivery-receipts) DLR (delivery receipt) SMS webhooks in Laravel php framework. Take a look at [contributing.md](contributing.md) to see a to do list.

When you make a successful request to the SMS API, it returns an array of message objects, one for each message. Ideally these will have a status of 0, indicating success. But this does not mean that your message has reached your recipients. It only means that your message has been successfully queued for sending.

Vonage's adaptive routing then identifies the best carrier for your message. When the selected carrier has delivered the message, it returns a delivery receipt (DLR).

To receive DLRs in your application, you must provide a webhook for Vonage to send them to. Alternatively, you could use the Reports API to periodically download your records, including per-message delivery status.

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

[](#installation)

Via Composer

```
composer require renatoxm/laravel-vonage-dlr-webhooks
```

Publish the config file with:

```
php artisan vendor:publish --provider="Renatoxm\LaravelVonageDlrWebhooks\LaravelVonageDlrWebhooksServiceProvider"
```

This package will log all incoming webhooks to the database by default.
Run the migrations to create a `vonage_dlr_webhook_logs` table in the database:

```
php artisan migrate
```

Setup DLR (delivery receipt) webhooks from Vonage
-------------------------------------------------

[](#setup-dlr-delivery-receipt-webhooks-from-vonage)

Create your account at [Nexmo](nexmo.com) and access the [dashboard API settings](https://dashboard.nexmo.com/settings).

Under SMS settings, choose SMS API, set the webhook format to `POST-JSON`, and configure Delivery receipts (DLR) webhooks URL like this:

`https:///api/webhooks/vonage/dlr`

`/api/webhooks/vonage/dlr` is the package's default endpoint.

> You may change the `/api/webhooks/vonage/dlr` endpoint to anything you like.
> You can do this by changing the `path` key in the `config/laravel-vonage-dlr-webhooks.php` file.

Events
------

[](#events)

Whenever a webhook call comes in, this package will fire a `LaravelVonageDlrWebhooksCalled` event.
You may register an event listener in the `EventServiceProvider`:

```
/**
 * The event listener mappings for the application.
 *
 * @var array
 */
protected $listen = [
    LaravelVonageDlrWebhooksCalled::class => [
        YourListener::class,
    ],
];
```

Example of a listener:

```
