PHPackages                             mohdradzee/laravel-wati-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. mohdradzee/laravel-wati-notification

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

mohdradzee/laravel-wati-notification
====================================

A custom Laravel notification channel for WATI WhatsApp API

v1.0.4(9mo ago)10MITPHPPHP ^8.1

Since May 14Pushed 9mo ago1 watchersCompare

[ Source](https://github.com/mohdradzee/laravel-wati-notification)[ Packagist](https://packagist.org/packages/mohdradzee/laravel-wati-notification)[ RSS](/packages/mohdradzee-laravel-wati-notification/feed)WikiDiscussions main Synced today

READMEChangelog (1)Dependencies (5)Versions (6)Used By (0)

📲 WATI Notification Channel for Laravel
=======================================

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

Send WhatsApp notifications via [WATI API](https://docs.wati.io) using Laravel's native notification system.

---

✨ Features
----------

[](#-features)

- Send WhatsApp messages via WATI using Laravel Notifications
- Custom notification channel (`wati`)
- Built-in support for multiple WATI API actions
- Clean, elegant API (`$user->notify(...)`)
- Easily extendable for new WATI endpoints
- Emits Laravel's `NotificationFailed` event on HTTP failures

---

📦 Installation
--------------

[](#-installation)

```
composer require mohdradzee/wati-notification
```

If Laravel doesn't auto-discover the service provider, add this manually:

```
// config/app.php

'providers' => [
    mohdradzee\WatiNotification\WatiNotificationServiceProvider::class,
],
```

---

⚙️ Configuration
----------------

[](#️-configuration)

Publish the config:

```
php artisan vendor:publish --tag=wati-config
```

This creates `config/wati.php`:

```
return [
    'token' => env('WATI_TOKEN'),
    'base_url' => env('WATI_BASE_URL', 'https://live-server.wati.io/441627/api/v1'),
];
```

Add the following to your `.env`:

```
WATI_TOKEN=your_api_token_here
WATI_BASE_URL=https://live-server.wati.io/441627/api/v1
```

---

🛠️ Create a Demo Notification
-----------------------------

[](#️-create-a-demo-notification)

### Step 1: Generate Notification

[](#step-1-generate-notification)

```
php artisan make:notification ConfirmWhatsappNumber
```

### Step 2: Edit `app/Notifications/ConfirmWhatsappNumber.php`

[](#step-2-edit-appnotificationsconfirmwhatsappnumberphp)

```
namespace App\Notifications;

use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Notification;
use mohdradzee\WatiNotification\WatiMessage;

class ConfirmWhatsappNumber extends Notification
{
    use Queueable;

    public function via($notifiable)
    {
        return ['wati'];
    }

    public function toWati($notifiable)
    {
        return WatiMessage::create()
            ->to($notifiable->phone)
            ->withAction('add_contact')
            ->withMeta([
                'fullName' => $notifiable->name,
                'customParams' => [
                    'source' => 'signup_page',
                ],
            ]);
    }
}
```

---

👤 Usage in a Notifiable Model
-----------------------------

[](#-usage-in-a-notifiable-model)

Make sure your model uses the `Notifiable` trait:

```
use Illuminate\Notifications\Notifiable;

class User extends Authenticatable
{
    use Notifiable;

    // Ensure `phone` attribute exists
}
```

Then notify the user:

```
$user = App\Models\User::first();
$user->notify(new App\Notifications\ConfirmWhatsappNumber());
```

---

✅ WatiMessage API
-----------------

[](#-watimessage-api)

```
WatiMessage::create()
    ->to('601122334455')
    ->withAction('send_template')
    ->withTemplate('template_name')
    ->withBroadcastName('broadcast1')
    ->withParameters([
        ['name' => 'name', 'value' => 'alibaba']
    ]);
```

---

🔌 Strategy Support (Dynamic API Calls)
--------------------------------------

[](#-strategy-support-dynamic-api-calls)

Each WATI API action is handled by its own **strategy class**:

ActionDescriptionStrategy Class`send_template`Send template message`SendTemplateStrategy``add_contact`Add a WhatsApp contact`AddContactStrategy`You can add your own by implementing:

```
use mohdradzee\WatiNotification\Contracts\WatiApiStrategy;

class MyCustomStrategy implements WatiApiStrategy
{
    public function execute(array $data): array
    {
        // call your custom WATI endpoint...
    }
}
```

Then register:

```
WatiApiExecutor::register('my_action', MyCustomStrategy::class);
```

---

🧪 Testing in Tinker
-------------------

[](#-testing-in-tinker)

```
php artisan tinker
```

```
$user = App\Models\User::first();
$user->notify(new App\Notifications\ConfirmWhatsappNumber());
```

---

📂 License
---------

[](#-license)

MIT License © [mohdradzee](https://github.com/mohdradzee)

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance58

Moderate activity, may be stable

Popularity2

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity50

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 ~34 days

Total

5

Last Release

279d ago

### Community

Maintainers

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

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mohdradzee-laravel-wati-notification/health.svg)

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

###  Alternatives

[craftcms/cms

Craft CMS

3.6k3.6M3.1k](/packages/craftcms-cms)[spatie/laravel-health

Monitor the health of a Laravel application

87512.0M167](/packages/spatie-laravel-health)[illuminate/http

The Illuminate Http package.

11937.9M7.0k](/packages/illuminate-http)[laravel-notification-channels/expo

Expo Notifications Channel for Laravel

67628.6k1](/packages/laravel-notification-channels-expo)[fleetbase/core-api

Core Framework and Resources for Fleetbase API

1235.9k20](/packages/fleetbase-core-api)[spatie/laravel-export

Create a static site bundle from a Laravel app

674146.0k6](/packages/spatie-laravel-export)

PHPackages © 2026

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