PHPackages                             bahricanli/whatsapp-bridge - 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. bahricanli/whatsapp-bridge

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

bahricanli/whatsapp-bridge
==========================

Laravel notification channel for WhatsApp via Baileys Bridge

v1.0.2(1mo ago)01MITPHPPHP &gt;=8.0

Since Apr 30Pushed 1mo agoCompare

[ Source](https://github.com/bahricanli/whatsapp-bridge)[ Packagist](https://packagist.org/packages/bahricanli/whatsapp-bridge)[ Docs](https://github.com/bahricanli/whatsapp-bridge)[ RSS](/packages/bahricanli-whatsapp-bridge/feed)WikiDiscussions main Synced 1w ago

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

WhatsApp Bridge — Laravel Notification Channel
==============================================

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

[![Latest Version](https://camo.githubusercontent.com/37f48a70eefe6036b01bfa2b3a4a3b98dccde3444054cdb443556000d4d47216/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f626168726963616e6c692f77686174736170702d6272696467652e737667)](https://packagist.org/packages/bahricanli/whatsapp-bridge)[![License: MIT](https://camo.githubusercontent.com/fdf2982b9f5d7489dcf44570e714e3a15fce6253e0cc6b5aa61a075aac2ff71b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d79656c6c6f772e737667)](LICENSE.md)

Laravel notification channel for sending WhatsApp messages via a self-hosted [Baileys](https://github.com/WhiskeySockets/Baileys) bridge.

Designed as a parallel channel alongside [bahricanli/netgsm](https://github.com/bahricanli/netgsm)— the API is intentionally similar for easy integration.

---

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

[](#requirements)

- PHP 8.0+
- Laravel 8+
- A running Baileys WhatsApp bridge (see [docker-sip-ai-service/whatsapp-bridge](https://github.com/bahricanli/docker-sip-ai-service))

---

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

[](#installation)

```
composer require bahricanli/whatsapp-bridge
```

Laravel's auto-discovery registers the service provider automatically.

Publish the config file:

```
php artisan vendor:publish --tag=whatsapp-bridge-config
```

---

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

[](#configuration)

Add the following to your `.env`:

```
WHATSAPP_BRIDGE_URL=http://localhost:3000
WHATSAPP_BRIDGE_API_KEY=           # optional
WHATSAPP_BRIDGE_TIMEOUT=10
```

Or edit `config/whatsapp-bridge.php` directly.

---

Usage
-----

[](#usage)

### 1. Direct usage (no notification system)

[](#1-direct-usage-no-notification-system)

```
use NotificationChannels\WhatsAppBridge\WhatsAppFacade as WhatsApp;
use NotificationChannels\WhatsAppBridge\WhatsAppMessage;

// Shorthand
WhatsApp::sendMessage('905551234567', 'Doğrulama kodunuz: 4821');

// Fluent message
WhatsApp::sendMessage(
    WhatsAppMessage::create('Doğrulama kodunuz: 4821')->to('905551234567')
);
```

### 2. As a Laravel notification channel

[](#2-as-a-laravel-notification-channel)

**In your notification class:**

```
use Illuminate\Notifications\Notification;
use NotificationChannels\WhatsAppBridge\WhatsAppChannel;
use NotificationChannels\WhatsAppBridge\WhatsAppMessage;

class PhoneVerificationNotification extends Notification
{
    public function __construct(private string $code) {}

    public function via($notifiable): array
    {
        return [WhatsAppChannel::class];
    }

    public function toWhatsApp($notifiable): WhatsAppMessage
    {
        return WhatsAppMessage::create("Doğrulama kodunuz: {$this->code}");
        // Recipient is pulled from routeNotificationForWhatsAppBridge()
    }
}
```

**In your notifiable model (e.g. `User`):**

```
public function routeNotificationForWhatsAppBridge(): string
{
    return $this->phone_number; // e.g. 905551234567
}
```

### 3. Parallel with NetGSM

[](#3-parallel-with-netgsm)

Send via both SMS and WhatsApp simultaneously:

```
public function via($notifiable): array
{
    return [
        \NotificationChannels\Netgsm\NetgsmChannel::class,
        \NotificationChannels\WhatsAppBridge\WhatsAppChannel::class,
    ];
}

public function toNetgsm($notifiable): string
{
    return "Doğrulama kodunuz: {$this->code}";
}

public function toWhatsApp($notifiable): WhatsAppMessage
{
    return WhatsAppMessage::create("Doğrulama kodunuz: {$this->code}");
}
```

---

Phone Number Formats
--------------------

[](#phone-number-formats)

The library normalizes phone numbers automatically:

InputStored as`905551234567``905551234567``+905551234567``905551234567``0905551234567``905551234567``05551234567``905551234567``5551234567``905551234567`---

Events
------

[](#events)

EventFired`SendingMessage`Before a message is sent`MessageWasSent`After successful delivery```
use NotificationChannels\WhatsAppBridge\Events\MessageWasSent;

Event::listen(MessageWasSent::class, function (MessageWasSent $event) {
    Log::info('WhatsApp sent', [
        'to'      => $event->message->to,
        'content' => $event->message->content,
    ]);
});
```

---

Bridge Status Check
-------------------

[](#bridge-status-check)

```
use NotificationChannels\WhatsAppBridge\WhatsAppFacade as WhatsApp;

$status = WhatsApp::status();
// ['ok' => true, 'connected' => true, 'sessions' => 3]
```

---

License
-------

[](#license)

MIT — see [LICENSE.md](LICENSE.md).

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance92

Actively maintained with recent releases

Popularity1

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~1 days

Total

3

Last Release

39d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4894f69d95bdf9814c8c0db5876852c4381ccaba0a2d98a224ea1269123217f8?d=identicon)[bmericc](/maintainers/bmericc)

---

Top Contributors

[![bmericc](https://avatars.githubusercontent.com/u/16552?v=4)](https://github.com/bmericc "bmericc (4 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/bahricanli-whatsapp-bridge/health.svg)

```
[![Health](https://phpackages.com/badges/bahricanli-whatsapp-bridge/health.svg)](https://phpackages.com/packages/bahricanli-whatsapp-bridge)
```

###  Alternatives

[spatie/laravel-health

Monitor the health of a Laravel application

88011.3M149](/packages/spatie-laravel-health)[craftcms/cms

Craft CMS

3.6k3.6M2.9k](/packages/craftcms-cms)[laravel-notification-channels/telegram

Telegram Notifications Channel for Laravel

1.1k3.7M42](/packages/laravel-notification-channels-telegram)[s-ichikawa/laravel-sendgrid-driver

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

4079.7M1](/packages/s-ichikawa-laravel-sendgrid-driver)[laravel-notification-channels/microsoft-teams

A Laravel Notification Channel for Microsoft Teams

1613.2M11](/packages/laravel-notification-channels-microsoft-teams)[erag/laravel-disposable-email

A Laravel package to detect and block disposable email addresses.

249143.0k](/packages/erag-laravel-disposable-email)

PHPackages © 2026

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