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

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

danidoble/laravel-notification-whatsapp
=======================================

WhatsApp notification channel for Laravel

v2.0.2(9mo ago)11.7kMITPHPPHP ^8.1CI failing

Since Dec 8Pushed 9mo agoCompare

[ Source](https://github.com/danidoble/laravel-notification-whatsapp)[ Packagist](https://packagist.org/packages/danidoble/laravel-notification-whatsapp)[ GitHub Sponsors](https://github.com/danidoble)[ RSS](/packages/danidoble-laravel-notification-whatsapp/feed)WikiDiscussions v2.x.x Synced 1mo ago

READMEChangelog (2)Dependencies (6)Versions (12)Used By (0)

WhatsApp notification channel for Laravel
=========================================

[](#whatsapp-notification-channel-for-laravel)

[![Latest Version on Packagist](https://camo.githubusercontent.com/faac2d6bd73da362cb4031fe70ad3b4906397cf5001028c90c3dfe3af823698c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f64616e69646f626c652f6c61726176656c2d6e6f74696669636174696f6e2d77686174736170702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/danidoble/laravel-notification-whatsapp/)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/c1afc517858849135be297483e59866702fff45817af752ae82a54e986814d46/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f64616e69646f626c652f6c61726176656c2d6e6f74696669636174696f6e2d77686174736170702f54657374732e7376673f7374796c653d666c61742d737175617265)](https://github.com/danidoble/laravel-notification-whatsapp/actions)[![StyleCI](https://camo.githubusercontent.com/d9b7db16c61f2aa133b1bbf8a736bdf4931ff3c0047b706dc4410736661419b1/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3537363030353035392f736869656c64)](https://camo.githubusercontent.com/d9b7db16c61f2aa133b1bbf8a736bdf4931ff3c0047b706dc4410736661419b1/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3537363030353035392f736869656c64)[![Quality Score](https://camo.githubusercontent.com/ca16dad3a285843848b21f1e9bdf4383c4fb3c57d3bb167d7e0e7f5d8c098aae/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f64616e69646f626c652f6c61726176656c2d6e6f74696669636174696f6e2d77686174736170702e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/danidoble/laravel-notification-whatsapp)[![Code Coverage](https://camo.githubusercontent.com/9a280a49b414051927dca644a4422b4a0fcbb0f809dad574371e015b4f8b2efd/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f64616e69646f626c652f6c61726176656c2d6e6f74696669636174696f6e2d77686174736170702f6d61696e2e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/danidoble/laravel-notification-whatsapp?branch=main)[![Total Downloads](https://camo.githubusercontent.com/415dd8db352c7b9edb7eda61b161dbaedec49b1d80d4eceb66f45df552a99a86/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f64616e69646f626c652f6c61726176656c2d6e6f74696669636174696f6e2d77686174736170702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/danidoble/laravel-notification-whatsapp/)

This package makes it easy to send notifications using [WhatsApp Cloud API](https://developers.facebook.com/docs/whatsapp/cloud-api/) with Laravel.

This package uses the [whatsapp-cloud-api](https://github.com/netflie/whatsapp-cloud-api) library that will allow you to send messages via the WhatsApp Cloud API from any type of project and framework written in PHP.

Forked from
-----------

[](#forked-from)

This package is a Fork from [netflie/laravel-notification-whatsapp](https://github.com/netflie/laravel-notification-whatsapp) to add support for Laravel 11

Check the CHANGELOG.md for more information about the changes.

Requirements
------------

[](#requirements)

- PHP 8.1 or higher
- Laravel 10.0 or higher

Contents
--------

[](#contents)

- [Installation](#installation)
    - [Setting up the WhatsApp service](#setting-up-the-WhatsApp-service)
- [Usage](#usage)
    - [Available Message methods](#available-message-methods)
- [Changelog](#changelog)
- [Testing](#testing)
- [Security](#security)
- [Contributing](#contributing)
- [Credits](#credits)
- [License](#license)

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

[](#installation)

You can install the package via composer:

```
composer require danidoble/laravel-notification-whatsapp

```

### Setting up the WhatsApp Cloud API

[](#setting-up-the-whatsapp-cloud-api)

Create a new Meta application and get your Whatsapp `application token` and `phone number id` following the ["Get Started"](https://developers.facebook.com/docs/whatsapp/cloud-api/get-started?locale=en_US#set-up-developer-assets)guide. Place them inside your `.env` file like this:

```
WHATSAPP_FROM_PHONE_NUMBER_ID=your-phone-number-id
WHATSAPP_TOKEN=your-token
```

Usage
-----

[](#usage)

The Whatsapp API only allows you to start conversations if you send a template message. This means that you will only be able to send template notifications from this package.

Whatsapp forces you to configure your templates before using them. You can learn how to configure your templates by following Meta's official guide on ["How to create templates"](https://developers.facebook.com/docs/whatsapp/cloud-api/guides/send-message-templates).

### WhatsApp templates sections

[](#whatsapp-templates-sections)

A template is divided into 4 sections: header, body, footer and buttons. The header, body and buttons accept variables. The footer doesn't accept variables. You can only send variables from this package for the header and body.

### Components

[](#components)

You have available several components that can be used to add context (variables) to your templates. The different components can be created with the component factory:

```
