PHPackages                             rezadaulay/filament-whatsapp-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. rezadaulay/filament-whatsapp-notification

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

rezadaulay/filament-whatsapp-notification
=========================================

Filament WhatsApp notification plugin using an external expressjs-baileys HTTP gateway.

v5.0.1(1mo ago)28MITPHPPHP ^8.2CI passing

Since Jul 4Pushed 1mo agoCompare

[ Source](https://github.com/rezadaulay/filament-whatsapp-notification)[ Packagist](https://packagist.org/packages/rezadaulay/filament-whatsapp-notification)[ Docs](https://github.com/rezadaulay/filament-whatsapp-notification)[ GitHub Sponsors](https://github.com/:vendor_name)[ RSS](/packages/rezadaulay-filament-whatsapp-notification/feed)WikiDiscussions main Synced 1w ago

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

Filament WhatsApp Notification
==============================

[](#filament-whatsapp-notification)

`rezadaulay/filament-whatsapp-notification` is a Filament plugin for Laravel that adds a WhatsApp notification channel backed by an external HTTP gateway. It lets your application queue outgoing WhatsApp messages, inspect delivery attempts, monitor gateway connectivity from Filament, and manually test the connection without building the admin tooling yourself.

This package is designed to work especially well with [rezadaulay/expressjs-baileys](https://github.com/rezadaulay/expressjs-baileys), a Baileys-powered WhatsApp gateway that exposes endpoints such as `/status`, `/qr`, `/send-message`, `/restart-socket`, `/restart`, and `/logout`.

Features
--------

[](#features)

- Laravel notification channel named `whatsapp`
- Filament plugin with:
    - WhatsApp connection page
    - notification log resource
    - stats widget
- Queue-based delivery flow with retry support
- Delivery log table for auditing and troubleshooting
- Gateway status checks and QR access from the Filament panel
- Configurable send delay, queue name, attempts, timeout, and default country code

How It Works
------------

[](#how-it-works)

The package stores outgoing WhatsApp notifications in a database table first. A queued job then processes pending records one by one and sends them to the configured HTTP gateway.

High-level flow:

1. Your Laravel notification returns a `WhatsappMessage`.
2. The `whatsapp` channel writes a log row into `whatsapp_notification_logs`.
3. A queued job picks the next pending message.
4. The job sends the message to the external gateway via HTTP.
5. The result is stored back in the log table and shown in Filament.

This design gives you traceability, retry behavior, and safer operational handling than sending directly inside the request lifecycle.

Relationship to `rezadaulay/expressjs-baileys#6`
------------------------------------------------

[](#relationship-to-rezadaulayexpressjs-baileys6)

This package depends on a separate gateway server and is intended to integrate with [rezadaulay/expressjs-baileys](https://github.com/rezadaulay/expressjs-baileys).

The pull request [rezadaulay/expressjs-baileys#6](https://github.com/rezadaulay/expressjs-baileys/pull/6), merged on **July 4, 2026**, translated the remaining Indonesian text in that gateway project into English. That matters here because:

- this Filament plugin is now easier to document fully in English end to end
- gateway API responses and operational messages are more consistent for English-speaking teams
- troubleshooting across the Laravel plugin and the gateway is clearer because both sides now use the same language

Functionally, this plugin talks to the gateway through HTTP endpoints. PR `#6` did not change that integration contract; it improved the gateway's English-facing developer and operational text.

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

[](#requirements)

- PHP `^8.2`
- Laravel components `^11.0|^12.0`
- Filament `^5.0`
- A running WhatsApp gateway, such as [rezadaulay/expressjs-baileys](https://github.com/rezadaulay/expressjs-baileys)
- A working Laravel queue worker

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

[](#installation)

Install the package:

```
composer require rezadaulay/filament-whatsapp-notification
```

Publish configuration and migrations:

```
php artisan vendor:publish --tag="filament-whatsapp-notification-config"
php artisan vendor:publish --tag="filament-whatsapp-notification-migrations"
php artisan migrate
```

If you are using Filament Panels with a custom theme, add the package views to your theme or app CSS source list:

```
@source '../../../../vendor/rezadaulay/filament-whatsapp-notification/resources/**/*.blade.php';
```

Then refresh Filament assets if needed:

```
php artisan filament:assets
php artisan optimize:clear
```

Gateway Setup
-------------

[](#gateway-setup)

Point this package to a running HTTP gateway. The default configuration expects:

```
http://127.0.0.1:5000

```

If you are using `rezadaulay/expressjs-baileys`, make sure the gateway is running, paired with WhatsApp, and reachable from your Laravel app.

Typical gateway endpoints used by this package:

- `GET /status`
- `GET /qr`
- `POST /send-message`
- `POST /restart-socket`
- `POST /restart`
- `POST /logout`

Filament Registration
---------------------

[](#filament-registration)

Register the plugin in your Filament panel provider:

```
use Rezadaulay\FilamentWhatsappNotification\FilamentWhatsappNotificationPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        ->plugins([
            FilamentWhatsappNotificationPlugin::make(),
        ]);
}
```

You can enable or disable individual pieces:

```
FilamentWhatsappNotificationPlugin::make()
    ->resource()
    ->statsWidget()
    ->connectionPage();
```

Or selectively disable them:

```
FilamentWhatsappNotificationPlugin::make()
    ->resource(false)
    ->statsWidget(false)
    ->connectionPage(true);
```

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

[](#configuration)

Published config: `config/filament-whatsapp-notification.php`

```
return [
    'enabled' => env('WHATSAPP_NOTIFICATION_ENABLED', true),
    'gateway' => [
        'base_url' => env('WHATSAPP_NOTIFICATION_GATEWAY_URL', 'http://127.0.0.1:5000'),
        'timeout' => (int) env('WHATSAPP_NOTIFICATION_TIMEOUT', 30),
        'country_code' => env('WHATSAPP_NOTIFICATION_COUNTRY_CODE', '62'),
        'check_status_before_send' => env('WHATSAPP_NOTIFICATION_CHECK_STATUS', false),
    ],
    'queue' => [
        'connection' => env('WHATSAPP_NOTIFICATION_QUEUE_CONNECTION', env('QUEUE_CONNECTION', 'database')),
        'queue' => env('WHATSAPP_NOTIFICATION_QUEUE', 'whatsapp-notifications'),
    ],
    'sending' => [
        'delay_min_seconds' => (int) env('WHATSAPP_NOTIFICATION_DELAY_MIN', 30),
        'delay_max_seconds' => (int) env('WHATSAPP_NOTIFICATION_DELAY_MAX', 60),
        'max_attempts' => (int) env('WHATSAPP_NOTIFICATION_MAX_ATTEMPTS', 2),
        'lock_ttl_seconds' => (int) env('WHATSAPP_NOTIFICATION_LOCK_TTL', 180),
        'stale_processing_minutes' => (int) env('WHATSAPP_NOTIFICATION_STALE_PROCESSING_MINUTES', 10),
    ],
    'table_name' => env('WHATSAPP_NOTIFICATION_TABLE', 'whatsapp_notification_logs'),
];
```

Recommended `.env` example:

```
WHATSAPP_NOTIFICATION_ENABLED=true
WHATSAPP_NOTIFICATION_GATEWAY_URL=http://127.0.0.1:5000
WHATSAPP_NOTIFICATION_TIMEOUT=30
WHATSAPP_NOTIFICATION_COUNTRY_CODE=62
WHATSAPP_NOTIFICATION_CHECK_STATUS=false

WHATSAPP_NOTIFICATION_QUEUE_CONNECTION=database
WHATSAPP_NOTIFICATION_QUEUE=whatsapp-notifications

WHATSAPP_NOTIFICATION_DELAY_MIN=30
WHATSAPP_NOTIFICATION_DELAY_MAX=60
WHATSAPP_NOTIFICATION_MAX_ATTEMPTS=2
WHATSAPP_NOTIFICATION_LOCK_TTL=180
WHATSAPP_NOTIFICATION_STALE_PROCESSING_MINUTES=10
```

Usage
-----

[](#usage)

### 1. Route the recipient

[](#1-route-the-recipient)

Your notifiable model can define a WhatsApp routing method:

```
use Illuminate\Notifications\Notifiable;

class User
{
    use Notifiable;

    public function routeNotificationForWhatsapp(): string
    {
        return $this->phone_number;
    }
}
```

### 2. Create a notification

[](#2-create-a-notification)

```
use Illuminate\Notifications\Notification;
use Rezadaulay\FilamentWhatsappNotification\Messages\WhatsappMessage;

class OrderPaidWhatsappNotification extends Notification
{
    public function via(object $notifiable): array
    {
        return ['whatsapp'];
    }

    public function toWhatsapp(object $notifiable): WhatsappMessage
    {
        return WhatsappMessage::make()
            ->content("Your order #{$this->order->number} has been paid.")
            ->payload([
                'order_id' => $this->order->id,
                'type' => 'order-paid',
            ]);
    }
}
```

### 3. Send the notification

[](#3-send-the-notification)

```
$user->notify(new OrderPaidWhatsappNotification($order));
```

### 4. Override destination or country code when needed

[](#4-override-destination-or-country-code-when-needed)

```
public function toWhatsapp(object $notifiable): WhatsappMessage
{
    return WhatsappMessage::make()
        ->to('081234567890')
        ->countryCode('62')
        ->content('Hello from WhatsApp')
        ->deduplicationKey('order-123-paid');
}
```

Running the Queue
-----------------

[](#running-the-queue)

This package relies on Laravel queues for actual delivery. Make sure a worker is running:

```
php artisan queue:work
```

If you want to process a dedicated queue:

```
php artisan queue:work --queue=whatsapp-notifications
```

Without a queue worker, notifications will be logged but not sent.

Filament Features
-----------------

[](#filament-features)

After registering the plugin, you get:

- a **WhatsApp Connection** page to inspect gateway status
- QR access through a signed proxy route
- actions to refresh status, restart the socket, reset the session, and log out
- a log resource for outgoing notifications
- a stats widget for operational visibility

The connection page also supports:

- direct test sending through the gateway
- queue-based test messages through the package pipeline

Operational Notes
-----------------

[](#operational-notes)

- Messages are processed sequentially with a lock to reduce concurrent-send issues.
- A random delay is applied between sends to avoid sending messages back to back too aggressively.
- Failed sends can return to `pending` until the configured max attempts is reached.
- Stale `processing` records are released automatically back to `pending`.
- If `check_status_before_send` is enabled, the package verifies gateway connectivity before each send attempt.

Troubleshooting
---------------

[](#troubleshooting)

### Messages stay pending

[](#messages-stay-pending)

Check these first:

- Laravel queue worker is running
- queue connection is configured correctly
- gateway URL is reachable from Laravel
- `WHATSAPP_NOTIFICATION_ENABLED=true`

### Gateway status fails in Filament

[](#gateway-status-fails-in-filament)

Usually one of these is the cause:

- the gateway server is offline
- the gateway base URL is wrong

### QR does not load

[](#qr-does-not-load)

The package shows the QR through a signed proxy route:

```
/filament-whatsapp-notification/qr-proxy

```

If the gateway itself is healthy but the QR is unavailable, the WhatsApp session may not have produced a QR yet, or it may already be connected.

### Notifications fail repeatedly

[](#notifications-fail-repeatedly)

Inspect the log resource in Filament and confirm:

- phone number format is valid
- default country code is correct
- the paired WhatsApp session is still connected
- the external gateway can send to that number

Testing
-------

[](#testing)

Run the package test suite with:

```
composer test
```

Changelog
---------

[](#changelog)

See [CHANGELOG.md](CHANGELOG.md) for recent changes.

License
-------

[](#license)

This package is open-sourced under the [MIT license](LICENSE.md).

###  Health Score

42

—

FairBetter than 88% of packages

Maintenance90

Actively maintained with recent releases

Popularity9

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor2

2 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 ~0 days

Total

3

Last Release

49d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/6315382?v=4)[Muhamad Alfisyah Reza Daulay](/maintainers/rezadaulay)[@rezadaulay](https://github.com/rezadaulay)

---

Top Contributors

[![awcodes](https://avatars.githubusercontent.com/u/3596800?v=4)](https://github.com/awcodes "awcodes (78 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (40 commits)")[![zepfietje](https://avatars.githubusercontent.com/u/44533235?v=4)](https://github.com/zepfietje "zepfietje (24 commits)")[![danharrin](https://avatars.githubusercontent.com/u/41773797?v=4)](https://github.com/danharrin "danharrin (22 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (22 commits)")[![rezadaulay](https://avatars.githubusercontent.com/u/6315382?v=4)](https://github.com/rezadaulay "rezadaulay (8 commits)")[![ryangjchandler](https://avatars.githubusercontent.com/u/41837763?v=4)](https://github.com/ryangjchandler "ryangjchandler (7 commits)")[![saade](https://avatars.githubusercontent.com/u/14329460?v=4)](https://github.com/saade "saade (4 commits)")[![maartenpaauw](https://avatars.githubusercontent.com/u/4550875?v=4)](https://github.com/maartenpaauw "maartenpaauw (4 commits)")[![AlexisSerneels](https://avatars.githubusercontent.com/u/287688?v=4)](https://github.com/AlexisSerneels "AlexisSerneels (2 commits)")[![lucasgiovanny](https://avatars.githubusercontent.com/u/4853801?v=4)](https://github.com/lucasgiovanny "lucasgiovanny (1 commits)")[![rahat1994](https://avatars.githubusercontent.com/u/25553141?v=4)](https://github.com/rahat1994 "rahat1994 (1 commits)")[![Z3d0X](https://avatars.githubusercontent.com/u/75579178?v=4)](https://github.com/Z3d0X "Z3d0X (1 commits)")[![ArielMejiaDev](https://avatars.githubusercontent.com/u/31971074?v=4)](https://github.com/ArielMejiaDev "ArielMejiaDev (1 commits)")[![a21ns1g4ts](https://avatars.githubusercontent.com/u/11599205?v=4)](https://github.com/a21ns1g4ts "a21ns1g4ts (1 commits)")[![artemind](https://avatars.githubusercontent.com/u/24897027?v=4)](https://github.com/artemind "artemind (1 commits)")[![atmonshi](https://avatars.githubusercontent.com/u/1952412?v=4)](https://github.com/atmonshi "atmonshi (1 commits)")[![cheesegrits](https://avatars.githubusercontent.com/u/934456?v=4)](https://github.com/cheesegrits "cheesegrits (1 commits)")[![darmshot](https://avatars.githubusercontent.com/u/29179227?v=4)](https://github.com/darmshot "darmshot (1 commits)")[![Abdulmajeed-Jamaan](https://avatars.githubusercontent.com/u/41128358?v=4)](https://github.com/Abdulmajeed-Jamaan "Abdulmajeed-Jamaan (1 commits)")

---

Tags

laravelnotificationwhatsappfilamentfilament-pluginfilamentphpbaileysrezadaulayexpressjs-baileys

###  Code Quality

TestsPest

Static AnalysisPHPStan, Rector

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/rezadaulay-filament-whatsapp-notification/health.svg)

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

###  Alternatives

[spatie/laravel-health

Monitor the health of a Laravel application

88212.7M190](/packages/spatie-laravel-health)[backstage/mails

View logged mails and events in a beautiful Filament UI.

16429.7k](/packages/backstage-mails)[defstudio/telegraph

A laravel facade to interact with Telegram Bots

818355.4k3](/packages/defstudio-telegraph)[rawilk/profile-filament-plugin

Profile &amp; MFA starter kit for filament.

3915.5k](/packages/rawilk-profile-filament-plugin)[bezhansalleh/filament-language-switch

Zero config Language Switch(Changer/Localizer) plugin for filamentphp admin

3591.4M41](/packages/bezhansalleh-filament-language-switch)[marcelweidum/filament-passkeys

Use passkeys in your filamentphp app

6758.2k2](/packages/marcelweidum-filament-passkeys)

PHPackages © 2026

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