PHPackages                             laraditz/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. [API Development](/categories/api)
4. /
5. laraditz/whatsapp

ActiveLibrary[API Development](/categories/api)

laraditz/whatsapp
=================

Laravel package for interacting with Official Whatsapp API.

1.0.3(3mo ago)122MITPHPPHP ^8.2CI passing

Since Feb 11Pushed 2mo agoCompare

[ Source](https://github.com/laraditz/whatsapp)[ Packagist](https://packagist.org/packages/laraditz/whatsapp)[ Docs](https://github.com/laraditz/whatsapp)[ Fund](https://www.buymeacoffee.com/raditzfarhan)[ GitHub Sponsors](https://github.com/raditzfarhan)[ RSS](/packages/laraditz-whatsapp/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (7)Versions (7)Used By (0)

Laravel WhatsApp
================

[](#laravel-whatsapp)

[![Latest Version on Packagist](https://camo.githubusercontent.com/8ffcab1a445f44aef867d402883e05d1cc9b5aa19731193eefd9cce13f244cc0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c6172616469747a2f77686174736170702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/laraditz/whatsapp)[![Total Downloads](https://camo.githubusercontent.com/43daec3edcf54e0536551154e1bee66d8d3534a378bc8c5c875df32e840464de/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c6172616469747a2f77686174736170702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/laraditz/whatsapp)[![GitHub Actions](https://github.com/laraditz/whatsapp/actions/workflows/main.yml/badge.svg)](https://github.com/laraditz/whatsapp/actions/workflows/main.yml/badge.svg)

A comprehensive Laravel package for seamless integration with the Official WhatsApp Cloud API.

[![Buy Me A Coffee](https://camo.githubusercontent.com/0cf29a542375e1a46e84d8bf5805a4e5c0a6ee98b6547ccdc0c55eed49d99c69/68747470733a2f2f63646e2e6275796d6561636f666665652e636f6d2f627574746f6e732f76322f64656661756c742d79656c6c6f772e706e67)](https://www.buymeacoffee.com/raditzfarhan)

Features
--------

[](#features)

- Multi-account support (config-based or database-driven)
- Fluent API for sending all message types (text, image, video, document, audio, sticker, location, contacts, interactive, template, reaction)
- Template management (list, create, update, delete)
- Webhook handling with automatic signature verification
- Laravel events for incoming messages and status updates
- Database logging for API requests, messages, webhooks, and templates
- Laravel notification channel for WhatsApp
- Artisan commands for syncing templates and message statuses

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

[](#requirements)

- PHP 8.2+
- Laravel 11 or 12

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

[](#installation)

Install the package via Composer:

```
composer require laraditz/whatsapp
```

Publish the config file:

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

Publish and run migrations (required for logging and database account driver):

```
php artisan vendor:publish --tag=whatsapp-migrations
php artisan migrate
```

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

[](#configuration)

Add the following to your `.env` file:

```
WHATSAPP_ACCESS_TOKEN=your-access-token
WHATSAPP_PHONE_NUMBER_ID=your-phone-number-id
WHATSAPP_BUSINESS_ACCOUNT_ID=your-business-account-id
WHATSAPP_WEBHOOK_VERIFY_TOKEN=your-verify-token
WHATSAPP_WEBHOOK_SECRET=your-app-secret
```

See [Configuration Guide](docs/configuration.md) for multi-account setup and all available options.

Quick Start
-----------

[](#quick-start)

### Sending Messages

[](#sending-messages)

```
use Laraditz\Whatsapp\Facades\Whatsapp;

// Text message
Whatsapp::message()->to('60123456789')->text('Hello!')->send();

// Image
Whatsapp::message()
    ->to('60123456789')
    ->image(link: 'https://example.com/photo.jpg', caption: 'Check this out')
    ->send();

// Template message
Whatsapp::message()
    ->to('60123456789')
    ->template(name: 'order_update', language: 'en')
    ->component(type: 'body', parameters: [
        ['type' => 'text', 'text' => 'ORDER-123'],
    ])
    ->send();
```

### Managing Templates

[](#managing-templates)

```
// List all templates
$response = Whatsapp::template()->list();

// Create a template
Whatsapp::template()->create(
    name: 'welcome_message',
    language: 'en',
    category: 'UTILITY',
    components: [
        ['type' => 'BODY', 'text' => 'Welcome, {{1}}!'],
    ],
);
```

### Laravel Notification

[](#laravel-notification)

```
use Illuminate\Notifications\Notification;
use Laraditz\Whatsapp\Channels\WhatsappChannel;
use Laraditz\Whatsapp\Messages\WhatsappMessage;

class OrderShipped extends Notification
{
    public function via($notifiable): array
    {
        return [WhatsappChannel::class];
    }

    public function toWhatsapp($notifiable): WhatsappMessage
    {
        return WhatsappMessage::create()
            ->template(name: 'order_update', language: 'en')
            ->component(type: 'body', parameters: [
                ['type' => 'text', 'text' => 'ORDER-123'],
            ]);
    }
}

// Send it
$user->notify(new OrderShipped($order));
```

### Multi-Account

[](#multi-account)

```
// Switch account
Whatsapp::account('support')->message()->to('60123456789')->text('Hi from support')->send();
```

Artisan Commands
----------------

[](#artisan-commands)

CommandDescription`php artisan whatsapp:sync-templates`Sync all templates from the WhatsApp API to the local database`php artisan whatsapp:sync-templates --account=support`Sync templates for a specific account`php artisan whatsapp:sync-messages`Sync message statuses for messages not yet delivered or read`php artisan whatsapp:sync-messages --account=default --since=2024-01-01`Sync messages for a specific account and date rangeDocumentation
-------------

[](#documentation)

- [Configuration Guide](docs/configuration.md) - Account drivers, logging, and all config options
- [Sending Messages](docs/sending-messages.md) - All message types with examples
- [Template Management](docs/template-management.md) - CRUD operations and syncing
- [Webhooks &amp; Events](docs/webhooks.md) - Webhook setup and Laravel event handling
- [Notifications](docs/notifications.md) - Laravel notification channel integration
- [Error Handling](docs/error-handling.md) - Exception types and handling patterns

Testing
-------

[](#testing)

```
composer test
```

### Changelog

[](#changelog)

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

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

[](#contributing)

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

### Security

[](#security)

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

Credits
-------

[](#credits)

- [Raditz Farhan](https://github.com/laraditz)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance83

Actively maintained with recent releases

Popularity11

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity51

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

4

Last Release

91d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1203676?v=4)[Raditz Farhan](/maintainers/raditzfarhan)[@raditzfarhan](https://github.com/raditzfarhan)

---

Top Contributors

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

---

Tags

apilaravelsdkfacebookwhatsappmetalaraditzraditzfarhan

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[missael-anda/laravel-whatsapp

A Whatsapp Business Cloud API wrapper for Laravel.

677.5k](/packages/missael-anda-laravel-whatsapp)[essa/api-tool-kit

set of tools to build an api with laravel

52680.5k](/packages/essa-api-tool-kit)[resend/resend-laravel

Resend for Laravel

1191.4M6](/packages/resend-resend-laravel)[flat3/lodata

OData v4.01 Producer for Laravel

96320.9k](/packages/flat3-lodata)[api-platform/laravel

API Platform support for Laravel

59126.4k6](/packages/api-platform-laravel)

PHPackages © 2026

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