PHPackages                             joemunapo/whatsapp-php - 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. joemunapo/whatsapp-php

ActiveLibrary[API Development](/categories/api)

joemunapo/whatsapp-php
======================

This package provides a seamless integration of the WhatsApp Cloud API for Laravel applications. It offers a flexible. Ideal for multi-tenant applications or businesses managing multiple WhatsApp accounts.

v1.0.2(1y ago)720[3 PRs](https://github.com/joemunapo/whatsapp-php/pulls)MITPHPPHP ^8.2CI passing

Since Apr 18Pushed 1w ago1 watchersCompare

[ Source](https://github.com/joemunapo/whatsapp-php)[ Packagist](https://packagist.org/packages/joemunapo/whatsapp-php)[ Docs](https://github.com/joemunapo/whatsapp-php)[ GitHub Sponsors](https://github.com/joemunapo)[ RSS](/packages/joemunapo-whatsapp-php/feed)WikiDiscussions main Synced today

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

Joe Munapo's WhatsApp PHP Package
=================================

[](#joe-munapos-whatsapp-php-package)

[![Latest Version on Packagist](https://camo.githubusercontent.com/faa00457bc01d8400420ffa0a25d04a9b0df37aefb802c664cd01ed6ad14769d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6a6f656d756e61706f2f77686174736170702d7068702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/joemunapo/whatsapp-php)[![GitHub Tests Action Status](https://camo.githubusercontent.com/5a7ca05ae58ccb9aba4e2ca47f34bf24871c20e83799daf1dd390867b1d53691/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6a6f656d756e61706f2f77686174736170702d7068702f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/joemunapo/whatsapp-php/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/c3d966c9e5cd9545617627d44d362b0a24e750a9fb37fd6e4b0a95aac10105e2/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6a6f656d756e61706f2f77686174736170702d7068702f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/joemunapo/whatsapp-php/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/974faab8a2d01101e8d077d967418ff13406ff428e6d28e43ad9f6e843b61606/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6a6f656d756e61706f2f77686174736170702d7068702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/joemunapo/whatsapp-php)

This package provides a simple and efficient way to integrate WhatsApp Cloud API functionality into your Laravel application.

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

[](#installation)

You can install the package via composer:

```
composer require joemunapo/whatsapp-php
```

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

[](#configuration)

After installation, publish the configuration file:

```
php artisan vendor:publish --provider="Joemunapo\Whatsapp\WhatsappServiceProvider"
```

Update the published config file in `config/whatsapp.php`:

```
return [
    'account_model' => \App\Models\Business::class,
    'fields' => [
        'number_id' => 'number_id',
        'token' => 'whatsapp_token',
        'catalog_id' => 'catalog_id',
    ],
];
```

Ensure your database model (e.g., `Business`) has the necessary fields to store WhatsApp account details.

Usage
-----

[](#usage)

### Initializing the WhatsApp instance

[](#initializing-the-whatsapp-instance)

```
use Joemunapo\Whatsapp\Whatsapp;

$whatsapp = Whatsapp::useNumberId('your_whatsapp_number_id');
```

### Sending a Text Message

[](#sending-a-text-message)

```
$to = '1234567890';
$content = (object) [
    'type' => 'text',
    'text' => [
        'body' => 'Hello, World!'
    ]
];

$messageId = $whatsapp->sendMessage($to, $content);
```

### Sending an Interactive Message (Buttons)

[](#sending-an-interactive-message-buttons)

```
$content = (object) [
    'type' => 'interactive',
    'text' => 'Please choose an option:',
    'buttons' => ['Option 1', 'Option 2', 'Option 3']
];

$whatsapp->sendMessage($to, $content);
```

### Sending Media

[](#sending-media)

```
$mediaType = 'image';
$mediaUrl = 'https://example.com/image.jpg';
$caption = 'Check out this image!';

$whatsapp->sendMedia($to, $mediaType, $mediaUrl, $caption);
```

### Sending a Template Message

[](#sending-a-template-message)

```
$templateName = 'hello_world';
$languageCode = 'en_US';
$components = [
    [
        'type' => 'body',
        'parameters' => [
            ['type' => 'text', 'text' => 'John Doe']
        ]
    ]
];

$whatsapp->sendTemplate($to, $templateName, $languageCode, $components);
```

### Handling Webhooks

[](#handling-webhooks)

```
$payload = // ... webhook payload from WhatsApp
$message = Whatsapp::handleWebhook($payload);

if ($message) {
    // Process the message
    $message->reply('Thank you for your message!');
}
```

### Getting Media

[](#getting-media)

When you receive a message with media (like an image, video, or document), you can retrieve the media content using the `getMedia` method:

```
$mediaId = 'media_id_from_webhook_payload';
$mediaInfo = $whatsapp->getMedia($mediaId);

// The $mediaInfo will contain details about the media, including the URL to download it
$mediaUrl = $mediaInfo['url'];

// You can then download and process the media as needed
```

Features
--------

[](#features)

- Send text messages
- Send interactive messages (buttons, lists, product lists)
- Send media (images, videos, documents)
- Send template messages
- Handle incoming messages via webhooks
- Mark messages as read
- Retrieve media content

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

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

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

[](#contributing)

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

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Joe Munapo](https://github.com/joemunapo)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

40

—

FairBetter than 86% of packages

Maintenance74

Regular maintenance activity

Popularity12

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 88.9% 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 ~0 days

Total

3

Last Release

440d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/63977646?v=4)[Joe Munapo](/maintainers/joemunapo)[@joemunapo](https://github.com/joemunapo)

---

Top Contributors

[![joemunapo](https://avatars.githubusercontent.com/u/63977646?v=4)](https://github.com/joemunapo "joemunapo (96 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (6 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (6 commits)")

---

Tags

whatsapp-apiwhatsapp-botwhatsapp-cloud-apilaravelWhatsApp-phpjoemunapo

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

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

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

###  Alternatives

[dedoc/scramble

Automatic generation of API documentation for Laravel applications.

2.1k11.2M97](/packages/dedoc-scramble)[spatie/laravel-pdf

Create PDFs in Laravel apps

1.0k4.8M46](/packages/spatie-laravel-pdf)[defstudio/telegraph

A laravel facade to interact with Telegram Bots

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

Profile &amp; MFA starter kit for filament.

3914.6k](/packages/rawilk-profile-filament-plugin)[harris21/laravel-fuse

Circuit breaker for Laravel queue jobs. Protect your workers from cascading failures.

44855.7k](/packages/harris21-laravel-fuse)[lettermint/lettermint-laravel

Official Lettermint driver for Laravel

1190.2k1](/packages/lettermint-lettermint-laravel)

PHPackages © 2026

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