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

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

clonixdev/laravel-whatsapp-notification-channel
===============================================

Whatsapp Notifications Channel for Laravel

v1.1.0(8mo ago)028MITPHPPHP ^7.2 || ^8.0

Since Sep 4Pushed 8mo agoCompare

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

READMEChangelogDependencies (6)Versions (4)Used By (0)

Whatsapp Notifications Channel for Laravel
==========================================

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

[![Latest Version on Packagist](https://camo.githubusercontent.com/aae8e698d8bfd19f7aa1741350fb11b7e075e62a83e9801c79e3806f1861990e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f66656c69706564616d6163656e6f74656f646f726f2f6c61726176656c2d77686174736170702d6e6f74696669636174696f6e2d6368616e6e656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/felipedamacenoteodoro/laravel-whatsapp-notification-channel)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Total Downloads](https://camo.githubusercontent.com/f6d41601b17f9bd0bf0d6f56709eafe7cc8969009c38d7a5709fcd26a66dea7d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f66656c69706564616d6163656e6f74656f646f726f2f6c61726176656c2d77686174736170702d6e6f74696669636174696f6e2d6368616e6e656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/felipedamacenoteodoro/laravel-whatsapp-notification-channel)

This package makes it easy to send Whatsapp notification using WPPCONNECT SERVER with Laravel.

This package was created based on the telegram notification package.

Thanks to Irfaq Syed for the codebase used here.

The packages is 100% free and opensource, if you are interested in hiring paid support, installation or implementation, [Felipe D. Teodoro](https://api.whatsapp.com/send?phone=5521972745771&text=Gostaria%20de%20mais%20informa%C3%A7%C3%B5es%20sobre%20o%20suporte%20do%20pacote%20Whatsapp%20Notifications%20Channel%20for%20Laravel)

Contents
--------

[](#contents)

- [Installation](#installation)
    - [Setting up your Whatsapp session](#setting-up-your-whatsapp-session)
    - [Proxy or Bridge Support](#proxy-or-bridge-support)
- [Usage](#usage)
    - [Text Notification](#text-notification)
    - [Attach a Contact](#attach-a-contact)
    - [Attach an Audio](#attach-an-audio)
    - [Attach a Photo](#attach-a-photo)
    - [Attach a Document](#attach-a-document)
    - [Attach a Location](#attach-a-location)
    - [Attach a Video](#attach-a-video)
    - [Attach a GIF File](#attach-a-gif-file)
    - [Routing a Message](#routing-a-message)
    - [Handling Response](#handling-response)
    - [On-Demand Notifications](#on-demand-notifications)
    - [Sending to Multiple Recipients](#sending-to-multiple-recipients)
- [Available Methods](#available-methods)
    - [Shared Methods](#shared-methods)
    - [Whatsapp Message methods](#whatsapp-message-methods)
    - [Whatsapp Location methods](#whatsapp-location-methods)
    - [Whatsapp File methods](#whatsapp-file-methods)
    - [Whatsapp Contact methods](#whatsapp-contact-methods)
    - [Whatsapp Poll methods](#whatsapp-poll-methods)
- [Alternatives](#alternatives)
- [Changelog](#changelog)
- [Testing](#testing)
- [Security](#security)
- [Contributing](#contributing)
- [Credits](#credits)
- [License](#license)

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

[](#installation)

You can install the package via composer:

```
composer require felipedamacenoteodoro/laravel-whatsapp-notification-channel
```

Publish config file
-------------------

[](#publish-config-file)

Publish the config file:

```
php artisan vendor:publish --tag=whatsapp-notification-channel-config
```

Setting up your Whatsapp session
--------------------------------

[](#setting-up-your-whatsapp-session)

Set your venom session WPPCONNECT SERVER and configure your Whatsapp Session:

```
# config/whatsapp-notification-channel/services.php

'whatsapp-bot-api' => [
        'whatsappSessionFieldName' => env('WHATSAPP_API_SESSION_FIELD_NAME', ''), //Session field name
        'whatsappSession' => env('WHATSAPP_API_SESSION', ''), // session value
        'base_uri' => env('WHATSAPP_API_BASE_URL', ''), //  Your venom base url api
        'mapMethods' => [
            'sendMessage' => 'sendText',
            'sendDocument' => 'sendFile',
        ], /* If you want to change the methods that will be called in the api, you can map them here, example: sendMessage will be replaced by the sendText method of the api */
    ],
```

Proxy or Bridge Support
-----------------------

[](#proxy-or-bridge-support)

You may not be able to send notifications if Whatsapp API is not accessible in your country, you can either set a proxy by following the instructions [here](http://docs.guzzlephp.org/en/stable/quickstart.html#environment-variables) or use a web bridge by setting the `base_uri` config above with the bridge uri.

You can set `HTTPS_PROXY` in your `.env` file.

Usage
-----

[](#usage)

You can now use the channel in your `via()` method inside the Notification class.

### Text Notification

[](#text-notification)

```
use NotificationChannels\Whatsapp\WhatsappMessage;
use Illuminate\Notifications\Notification;

class InvoicePaid extends Notification
{
    public function via($notifiable)
    {
        return ["whatsapp"];
    }

    public function toWhatsapp($notifiable)
    {
        $url = url('/invoice/' . $this->invoice->id);

        return WhatsappMessage::create()
            // Optional recipient user id.
            ->to($notifiable->whatsapp_number)
            // Markdown supported.
            ->content("Hello there!\nYour invoice has been *PAID*")

            // (Optional) Blade template for the content.
            // ->view('notification', ['url' => $url])
    }
}
```

### Attach an Audio

[](#attach-an-audio)

```
public function toWhatsapp($notifiable)
{
    return WhatsappFile::create()
            ->to($notifiable->whatsapp_number) // Optional
            ->content('Audio') // Optional Caption
            ->audio('/path/to/audio.mp3');
}
```

### Attach a Photo

[](#attach-a-photo)

```
public function toWhatsapp($notifiable)
{
    return WhatsappFile::create()
        ->to($notifiable->whatsapp_number) // Optional
        ->content('Awesome *bold* text')
        ->file('/storage/archive/6029014.jpg', 'photo'); // local photo

        // OR using a helper method with or without a remote file.
        // ->photo('https://file-examples-com.github.io/uploads/2017/10/file_example_JPG_1MB.jpg');
}
```

### Attach a Document

[](#attach-a-document)

```
public function toWhatsapp($notifiable)
{
    return WhatsappFile::create()
        ->to($notifiable->whatsapp_number) // Optional
        ->content('Did you know we can set a custom filename too?')
        ->document('https://file-examples-com.github.io/uploads/2017/10/file-sample_150kB.pdf', 'sample.pdf');
}
```

### Attach a Location

[](#attach-a-location)

```
public function toWhatsapp($notifiable)
{
    return WhatsappLocation::create()
        ->latitude('40.6892494')
        ->longitude('-74.0466891');
}
```

### Attach a Video

[](#attach-a-video)

```
public function toWhatsapp($notifiable)
{
    return WhatsappFile::create()
        ->content('Sample *video* notification!')
        ->video('https://file-examples-com.github.io/uploads/2017/04/file_example_MP4_480_1_5MG.mp4');
}
```

### Attach a GIF File

[](#attach-a-gif-file)

```
public function toWhatsapp($notifiable)
{
    return WhatsappFile::create()
        ->content('Woot! We can send animated gif notifications too!')
        ->animation('https://sample-videos.com/gif/2.gif');

        // Or local file
        // ->animation('/path/to/some/animated.gif');
}
```

### Routing a Message

[](#routing-a-message)

You can either send the notification by providing with the whatapp number of the recipient to the `to($whatsapp_number)` method like shown in the previous examples or add a `routeNotificationForWhatsapp()` method in your notifiable model:

```
/**
 * Route notifications for the Whatsapp channel.
 *
 * @return int
 */
public function routeNotificationForWhatsapp()
{
    return $this->whatsapp_number;
}
```

### Handling Response

[](#handling-response)

You can make use of the [notification events](https://laravel.com/docs/5.8/notifications#notification-events) to handle the response from Whatsapp. On success, your event listener will receive a [Message](https://core.whatsapp.org/bots/api#message) object with various fields as appropriate to the notification type.

For a complete list of response fields, please refer the Venom Whatsapp API's [Message object](https://orkestral.github.io/venom/index.html) docs.

### On-Demand Notifications

[](#on-demand-notifications)

> Sometimes you may need to send a notification to someone who is not stored as a "user" of your application. Using the `Notification::route` method, you may specify ad-hoc notification routing information before sending the notification. For more details, you can check out the [on-demand notifications](https://laravel.com/docs/8.x/notifications#on-demand-notifications) docs.

```
use Illuminate\Support\Facades\Notification;

Notification::route('whatsapp', 'WHATSAPP_SESSION')
            ->notify(new InvoicePaid($invoice));
```

### Sending to Multiple Recipients

[](#sending-to-multiple-recipients)

Using the [notification facade](https://laravel.com/docs/8.x/notifications#using-the-notification-facade) you can send a notification to multiple recipients at once.

> If you're sending bulk notifications to multiple users, the Whatsapp API will not allow more than 30 messages per second or so. Consider spreading out notifications over large intervals of 8—12 hours for best results.
>
> Also note that your bot will not be able to send more than 20 messages per minute to the same group.
>
> If you go over the limit, you'll start getting `429` errors. For more details, refer Whatsapp Api [FAQ](https://faq.whatsapp.com/).

```
use Illuminate\Support\Facades\Notification;

// Recipients can be an array of numbers or collection of notifiable entities.
Notification::send($recipients, new InvoicePaid());
```

Available Methods
-----------------

[](#available-methods)

### Shared Methods

[](#shared-methods)

> These methods are optional and shared across all the API methods.

- `to(int|string $number)`: Recipient's number.
- `session(string $session)`: Session if you wish to override the default session for a specific notification.
- `options(array $options)`: Allows you to add additional params or override the payload.
- `getPayloadValue(string $key)`: Get payload value for given key.

### Whatsapp Message methods

[](#whatsapp-message-methods)

For more information on supported parameters, check out these [docs](https://orkestral.github.io/venom/index.html).

- `content(string $content, int $limit = null)`: Notification message, supports markdown. For more information on supported markdown styles, check out these [docs](https://faq.whatsapp.com/general/chats/how-to-format-your-messages/?lang=pt_br).
- `view(string $view, array $data = [], array $mergeData = [])`: (optional) Blade template name with Whatsapp supported Markdown syntax content if you wish to use a view file instead of the `content()` method.
- `chunk(int $limit = 4096)`: (optional) Message chars chunk size to send in parts (For long messages). Note: Chunked messages will be rate limited to one message per second to comply with rate limitation requirements from Whatsapp.

### Whatsapp Location methods

[](#whatsapp-location-methods)

- `latitude(float|string $latitude)`: Latitude of the location.
- `longitude(float|string $longitude)`: Longitude of the location.
- `title(string $title)`: Title of location
- `description(string $description)`: description of location

### Whatsapp File methods

[](#whatsapp-file-methods)

- `content(string $content)`: (optional) File caption, supports markdown. For more information on supported markdown styles, check out these [docs](https://orkestral.github.io/venom/interfaces/SendFileResult.html).
- `view(string $view, array $data = [], array $mergeData = [])`: (optional) Blade template name with Whatsapp supported HTML or Markdown syntax content if you wish to use a view file instead of the `content()` method.
- `file(string|resource|StreamInterface $file, string $type, string $filename = null)`: Local file path or remote URL, `$type` of the file (Ex:`photo`, `audio`, `document`, `video`, `animation`, `voice`, `video_note`) and optionally filename with extension. Ex: `sample.pdf`. You can use helper methods instead of using this to make it easier to work with file attachment.
- `photo(string $file)`: Helper method to attach a photo.
- `audio(string $file)`: Helper method to attach an audio file (MP3 file).
- `document(string $file, string $filename = null)`: Helper method to attach a document or any file as document.
- `video(string $file)`: Helper method to attach a video file.
- `animation(string $file)`: Helper method to attach an animated gif file.

### Whatsapp Contact methods

[](#whatsapp-contact-methods)

- `phoneNumber(string $phoneNumber)`: Contact phone number.
- `name(string $name)`: Full name.
- `firstName(string $firstName)`: (optional if you use name param) Contact first name.
- `lastName(string $lastName)`: (optional) Contact last name.

Simple Whatsapp Api
-------------------

[](#simple-whatsapp-api)

For simple use, please consider using [whatsapp-api](https://orkestral.github.io/venom/index.html) instead.

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Credits
-------

[](#credits)

- [Felipe D. Teodoro](https://www.linkedin.com/in/felipedamacenoteodoro)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance60

Regular maintenance activity

Popularity7

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 70% 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 ~181 days

Total

3

Last Release

253d ago

### Community

Maintainers

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

---

Top Contributors

[![felipedamacenoteodoro](https://avatars.githubusercontent.com/u/13315400?v=4)](https://github.com/felipedamacenoteodoro "felipedamacenoteodoro (7 commits)")[![erikn69](https://avatars.githubusercontent.com/u/4933954?v=4)](https://github.com/erikn69 "erikn69 (3 commits)")

---

Tags

laravelnotificationwhatsappwhatsapp notificationwhatsapp notifications channel

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/clonixdev-laravel-whatsapp-notification-channel/health.svg)

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

###  Alternatives

[laravel-notification-channels/telegram

Telegram Notifications Channel for Laravel

1.1k3.4M35](/packages/laravel-notification-channels-telegram)[netflie/laravel-notification-whatsapp

Laravel notification driver for WhatsApp

176173.9k](/packages/netflie-laravel-notification-whatsapp)[felipedamacenoteodoro/laravel-whatsapp-notification-channel

Whatsapp Notifications Channel for Laravel

984.0k](/packages/felipedamacenoteodoro-laravel-whatsapp-notification-channel)[laravel-notification-channels/discord

Laravel notification driver for Discord.

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

Flexible flash notifications for Laravel

1.7k1.1M5](/packages/mckenziearts-laravel-notify)[s-ichikawa/laravel-sendgrid-driver

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

4139.3M1](/packages/s-ichikawa-laravel-sendgrid-driver)

PHPackages © 2026

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