PHPackages                             aghfatehi/laravel-whatsapp-api - 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. aghfatehi/laravel-whatsapp-api

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

aghfatehi/laravel-whatsapp-api
==============================

Meta WhatsApp Cloud API integration for Laravel 9-13. Supports all API services: messaging, media, templates, phone numbers, business profile, webhooks, QR codes, and conversations.

v1.0.0(1mo ago)047MITPHPPHP ^8.0CI passing

Since Jun 1Pushed 1mo agoCompare

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

READMEChangelogDependencies (9)Versions (2)Used By (0)

aghfatehi/laravel-whatsapp-api
==============================

[](#aghfatehilaravel-whatsapp-api)

 [![Packagist Version](https://camo.githubusercontent.com/97baf768b6f87739bc0569eb3d047b826f7f8fcfc47698028ae04594937f7368/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6167686661746568692f6c61726176656c2d77686174736170702d6170692e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/aghfatehi/laravel-whatsapp-api) [![Total Downloads](https://camo.githubusercontent.com/2e2879e8207ea1355c7c382adaf47d2dfd29f203d316bf591a67b83827ccc512/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6167686661746568692f6c61726176656c2d77686174736170702d6170692e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/aghfatehi/laravel-whatsapp-api) [![PHP Version](https://camo.githubusercontent.com/65d71a5a41df16999e6a2a96071a38b9a5e51269c73d2b4ed60d9b1c4392164b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6167686661746568692f6c61726176656c2d77686174736170702d6170693f7374796c653d666c61742d737175617265)](https://packagist.org/packages/aghfatehi/laravel-whatsapp-api) [![Laravel](https://camo.githubusercontent.com/3e372d54f131421652de913948eaef4603a8966b8fa30a334de2e5dab2a7d534/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d397e31332d7265643f7374796c653d666c61742d737175617265266c6f676f3d6c61726176656c)](https://packagist.org/packages/aghfatehi/laravel-whatsapp-api) [![License](https://camo.githubusercontent.com/263d5d350c3018c4ffbac12e30bf0b78b4cb484e2b4e0c41fe0d4d422d59d6b1/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6167686661746568692f6c61726176656c2d77686174736170702d6170693f7374796c653d666c61742d737175617265)](https://github.com/aghfatehi/laravel-whatsapp-api/blob/main/LICENSE) [![Tests](https://camo.githubusercontent.com/070d55570d572056a6df3cbb99e3fdafdad096546ae465a6a68f40b8e096e722/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6167686661746568692f6c61726176656c2d77686174736170702d6170692f74657374732e796d6c3f7374796c653d666c61742d737175617265266c6162656c3d7465737473)](https://github.com/aghfatehi/laravel-whatsapp-api/actions)

Meta WhatsApp Cloud API integration for Laravel 9–13.
Supports all API services: messaging, media, templates, phone numbers, business profile, webhooks, QR codes, two-step verification, and conversations.

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

[](#installation)

```
composer require aghfatehi/laravel-whatsapp-api
php artisan vendor:publish --tag=whatsapp-config
```

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

[](#configuration)

Add to your `.env`:

```
WHATSAPP_API_TOKEN=
WHATSAPP_PHONE_NUMBER_ID=
WHATSAPP_WABA_ID=
WHATSAPP_APP_SECRET=
WHATSAPP_VERIFY_TOKEN=
```

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

[](#quick-start)

```
use Aghfatehi\WhatsApp\Facades\WhatsApp;

// Send a text message
WhatsApp::messages()->sendText('966555555555', 'Hello!');

// Send a media message (image, document, audio, video)
WhatsApp::messages()->sendMedia('966555555555', 'image', 'https://example.com/photo.jpg', 'Caption');

// Send a template message
WhatsApp::messages()->sendTemplate('966555555555', 'hello_world', 'en');

// Send a location
WhatsApp::messages()->sendLocation('966555555555', 24.7136, 46.6753, 'Riyadh', 'Saudi Arabia');

// Send an interactive (button/list)
WhatsApp::messages()->sendInteractive('966555555555', [
    'type' => 'button',
    'body' => ['text' => 'Choose:'],
    'action' => [
        'buttons' => [
            ['type' => 'reply', 'reply' => ['id' => '1', 'title' => 'Yes']],
            ['type' => 'reply', 'reply' => ['id' => '2', 'title' => 'No']],
        ],
    ],
]);

// Send reaction
WhatsApp::messages()->sendReaction('966555555555', 'wamid.xxx', '👍');

// Mark message as read
WhatsApp::messages()->markAsRead('wamid.xxx');
```

All Services
------------

[](#all-services)

### Messages

[](#messages)

```
WhatsApp::messages()->sendText($to, $body, $previewUrl);
WhatsApp::messages()->sendMedia($to, $type, $url, $caption, $filename);
WhatsApp::messages()->sendMediaById($to, $type, $mediaId, $caption, $filename);
WhatsApp::messages()->sendTemplate($to, $name, $lang, $components);
WhatsApp::messages()->sendInteractive($to, $data);
WhatsApp::messages()->sendLocation($to, $lat, $lng, $name, $address);
WhatsApp::messages()->sendContacts($to, $contacts);
WhatsApp::messages()->sendReaction($to, $messageId, $emoji);
WhatsApp::messages()->markAsRead($messageId);
```

### Media

[](#media)

```
WhatsApp::media()->upload($filePath, $type);     // Upload to WhatsApp servers
WhatsApp::media()->getUrl($mediaId);               // Get download URL
WhatsApp::media()->download($mediaId);             // Download raw content
WhatsApp::media()->delete($mediaId);               // Delete from WhatsApp
```

### Phone Numbers

[](#phone-numbers)

```
WhatsApp::phoneNumbers()->list();                  // All phone numbers
WhatsApp::phoneNumbers()->get($phoneNumberId);      // Single number details
WhatsApp::phoneNumbers()->requestPin($phoneNumberId);
WhatsApp::phoneNumbers()->verifyPin($phoneNumberId, $pin);
WhatsApp::phoneNumbers()->deregister($phoneNumberId);
```

### Business Profile

[](#business-profile)

```
WhatsApp::businessProfile()->get($phoneNumberId);
WhatsApp::businessProfile()->update($phoneNumberId, $data);
```

### Templates

[](#templates)

```
WhatsApp::templates()->list($status, $limit);
WhatsApp::templates()->get($templateId);
WhatsApp::templates()->create($data);
WhatsApp::templates()->update($templateId, $data);
WhatsApp::templates()->delete($templateId);
```

### QR Codes

[](#qr-codes)

```
WhatsApp::qrCodes()->create($prefilledMessage);
WhatsApp::qrCodes()->list();
WhatsApp::qrCodes()->get($qrCodeId);
WhatsApp::qrCodes()->update($qrCodeId, $data);
WhatsApp::qrCodes()->delete($qrCodeId);
```

### Two-Step Verification

[](#two-step-verification)

```
WhatsApp::twoStepVerification()->setPin($phoneNumberId, $pin);
WhatsApp::twoStepVerification()->deletePin($phoneNumberId);
```

### Conversations

[](#conversations)

```
WhatsApp::conversations()->list($phoneNumberId, $filters);
WhatsApp::conversations()->getAnalytics($phoneNumberId, $dimensions);
WhatsApp::conversations()->getPricing($phoneNumberId);
```

### Webhook

[](#webhook)

```
WhatsApp::webhook()->verifyToken($mode, $token, $challenge);
WhatsApp::webhook()->verifySignature($body, $signature);
WhatsApp::webhook()->parsePayload($payload);
WhatsApp::webhook()->handle($payload);
```

The package auto-registers these routes:

- `GET  /api/whatsapp/webhook` — webhook verification
- `POST /api/whatsapp/webhook` — incoming messages + status updates

Multi-Connection
----------------

[](#multi-connection)

```
WhatsApp::connection('default')->messages()->sendText(...);
WhatsApp::connection('secondary')->messages()->sendText(...);
```

Define connections in `config/whatsapp.php`:

```
'connections' => [
    'default' => [
        'api_token' => env('WHATSAPP_API_TOKEN'),
        'phone_number_id' => env('WHATSAPP_PHONE_NUMBER_ID'),
        'waba_id' => env('WHATSAPP_WABA_ID'),
    ],
    'secondary' => [
        'api_token' => env('WHATSAPP_API_TOKEN_2'),
        'phone_number_id' => env('WHATSAPP_PHONE_NUMBER_ID_2'),
        'waba_id' => env('WHATSAPP_WABA_ID_2'),
    ],
],
```

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

[](#artisan-commands)

```
php artisan whatsapp:setup              # Validate configuration
php artisan whatsapp:phone-numbers      # List connected phone numbers
php artisan whatsapp:register-webhook   # Register webhook URL
```

Database Support
----------------

[](#database-support)

The package is **database-agnostic** — it does not ship migrations.
You can store WhatsApp data in any database:

- **MySQL** / **MariaDB** — default, no changes needed
- **PostgreSQL** — no changes needed
- **SQLite** — no changes needed
- **MongoDB** — add `mongodb/laravel-mongodb` package

Testing
-------

[](#testing)

```
composer test
# or
vendor/bin/phpunit
```

License
-------

[](#license)

MIT

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance89

Actively maintained with recent releases

Popularity11

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

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

Unknown

Total

1

Last Release

54d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7c0d20683d29aa61fca6b1f9a47a754b2d3e177750f1e8d66975979f2ae8813f?d=identicon)[aghfatehi](/maintainers/aghfatehi)

---

Tags

api-integrationbusiness-apichatbotcloud-apicrmlaravellaravel-packagemessagingmetamulti-tenantnotificationsphpsms-alternativewebhookswhatsappwhatsapp-apilaravelmessagingwhatsappmetawhatsapp-cloud-apiwhatsapp-api

###  Code Quality

TestsPHPUnit

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/aghfatehi-laravel-whatsapp-api/health.svg)

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

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.3M347](/packages/psalm-plugin-laravel)[laravel/socialite

Laravel wrapper around OAuth 1 &amp; OAuth 2 libraries.

5.7k108.5M925](/packages/laravel-socialite)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

255.2k](/packages/aedart-athenaeum)[spatie/laravel-export

Create a static site bundle from a Laravel app

674146.0k6](/packages/spatie-laravel-export)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9762.4M133](/packages/roots-acorn)[simplestats-io/laravel-client

Server-side analytics for Laravel that follows the full funnel from visit to registration to payment, attributed to the channel that drove it. Revenue, MRR, churn and ad-spend profit (ROAS/CAC) per channel. GDPR compliant, ad-blocker proof.

5022.6k](/packages/simplestats-io-laravel-client)

PHPackages © 2026

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