PHPackages                             dogfromthemoon/laravel-whatsapp-sender - 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. dogfromthemoon/laravel-whatsapp-sender

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

dogfromthemoon/laravel-whatsapp-sender
======================================

Laravel WhatsApp Sender lets you send WhatsApp messages from your Laravel application.

71261PHP

Since Jan 17Pushed 3mo ago2 watchersCompare

[ Source](https://github.com/porrello/laravel-whatsapp-sender)[ Packagist](https://packagist.org/packages/dogfromthemoon/laravel-whatsapp-sender)[ RSS](/packages/dogfromthemoon-laravel-whatsapp-sender/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Laravel WhatsApp Sender
=======================

[](#laravel-whatsapp-sender)

[![Latest Version on Packagist](https://camo.githubusercontent.com/e6f4fe1665989c7f5bbddcfd3bbeb5b59b5473a13b016c7b6bf82262cd0b659e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f646f6766726f6d7468656d6f6f6e2f6c61726176656c2d77686174736170702d73656e6465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/dogfromthemoon/laravel-whatsapp-sender)[![Total Downloads](https://camo.githubusercontent.com/a7578b54c36a8b61b5176645065bf2bd00f3355e9b88881a8e88405e6aa36997/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f646f6766726f6d7468656d6f6f6e2f6c61726176656c2d77686174736170702d73656e6465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/dogfromthemoon/laravel-whatsapp-sender)[![GitHub Actions](https://github.com/porrello/laravel-whatsapp-sender/actions/workflows/main.yml/badge.svg)](https://github.com/porrello/laravel-whatsapp-sender/actions/workflows/main.yml/badge.svg)

Laravel WhatsApp Sender is a package for sending WhatsApp messages from Laravel.

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

[](#requirements)

- PHP 8.2+
- Laravel 11.x / 12.x

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

[](#installation)

You can install the package via composer:

```
composer require dogfromthemoon/laravel-whatsapp-sender
```

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

[](#configuration)

Before you can use Laravel WhatsApp Sender, you need to set your WhatsApp API credentials in your `.env` file:

```
WHATSAPP_PHONE_NUMBER_ID=
WHATSAPP_TOKEN=
```

You can obtain your WhatsApp API credentials from the [Facebook Business Manager](https://developers.facebook.com/apps) website.

1. Create a new app.
2. Add the WhatsApp product to your app.
3. Add a phone number to your app, which will serve as your WhatsApp business account.
4. Generate a permanent token for your WhatsApp business account.
5. Add your webhook URL to your app.

### Here is a simple example of how to validate the webhook challenge code

[](#here-is-a-simple-example-of-how-to-validate-the-webhook-challenge-code)

```
Route::get('/verification', function(Request $request) {
    $challenge = $request->input('hub_challenge');

    // Validate the challenge code you provided when you created the webhook
    // For example, you can compare it with a value stored in your configuration
    $isValid = ($challenge === 'super-secret-challenge-code');

    if ($isValid) {
        return $challenge;
    } else {
        abort(404);
    }
});
```

Usage
-----

[](#usage)

### Remember to import the thing

[](#remember-to-import-the-thing)

```
use Dogfromthemoon\LaravelWhatsappSender\LaravelWhatsappSender;
```

### Sending Messages

[](#sending-messages)

```
// If the conversation was started by the user, you can use this method to send messages.
// If you want to start a new conversation, you will need to use a template.

$whatsappSender = new LaravelWhatsappSender();

$phone = '1234567890'; // Phone number in E.164 format

$message = 'Hello, this is a test message!';

$response = $whatsappSender->sendTextMessage($phone, $message);
```

### Sending Interactive Lists

[](#sending-interactive-lists)

```
$phone = '1234567890';
$message = 'Please select an item from the list';
$sections = [
    [
        "rows" => [
            [
                "title" => "Item 1",
                "description" => "Description of Item 1",
                "id" => "item1"
            ],
            [
                "title" => "Item 2",
                "description" => "Description of Item 2",
                "id" => "item2"
            ]
        ]
    ]
];

$whatsappSender = new LaravelWhatsappSender();
$response = $whatsappSender->sendInteractiveList($phone, $message, $sections, 'VIEW');
```

### Sending Buttons Lists

[](#sending-buttons-lists)

```
$phone = '1234567890';
$message = 'Please choose an option:';
$buttons = [
    [
        'type' => 'reply',
        'reply' => [
            'id' => 'unique-id-paynow',
            'title' => 'button_pay_now',
        ]
    ],
    [
        'type' => 'reply',
        'reply' => [
            'id' => 'unique-id-moreoptions',
            'title' => 'button_more_options',
        ]
    ]
];

$response = $whatsappSender->sendButtonsMessage($phone, $message, $buttons);
```

### Sending Multi Product Messages

[](#sending-multi-product-messages)

```
$header = 'header-content';
$body = 'body-content';
$footer = 'footer-content';
$catalogId = 'CATALOG_ID';
$sections = [
    [
        'title' => 'section-title',
        'product_items' => [
            ['product_retailer_id' => 'product-SKU-in-catalog'],
            ['product_retailer_id' => 'product-SKU-in-catalog']
        ]
    ],
    [
        'title' => 'section-title',
        'product_items' => [
            ['product_retailer_id' => 'product-SKU-in-catalog'],
            ['product_retailer_id' => 'product-SKU-in-catalog']
        ]
    ]
];

$phone = '+1234567890';

$response = $whatsappSender->sendMultiProductMessage($phone, $header, $body, $footer, $catalogId, $sections);
```

### Sending Single Product Messages

[](#sending-single-product-messages)

```
$phone = '1234567890'; // Phone number in E.164 format
$catalogId = 'CATALOG_ID'; // The catalog ID for the product
$productId = 'PRODUCT_ID'; // The product retailer ID in the catalog
$bodyText = 'This is the body text of the product message';
$footerText = 'This is the footer text of the product message';

$response = $whatsappSender->sendProductMessage($phone, $catalogId, $productId, $bodyText, $footerText);
```

### Reply to Messages

[](#reply-to-messages)

```
// The phone number of the recipient in E.164 format
$phone = '1234567890';
// The message ID of the message you're replying to
$messageId = '12345';
// The text of the reply message
$reply = 'This is my reply to your message!';
$response = $whatsappSender->sendReplyToMessage($phone, $messageId, $reply);
```

### Reaction Messages

[](#reaction-messages)

```
$phone = '1234567890';
$messageId = 'wamid.HBgLM...';
$emoji = '\uD83D\uDE00';
$response = $whatsappSender->sendReaction($phone, $messageId, $emoji);
```

### Media Messages

[](#media-messages)

```
$phone = '1234567890'; // Phone number in E.164 format
$imageId = 'MEDIA-OBJECT-ID';

$response = $whatsappSender->sendImageMessage($phone, $imageId);
```

### Location Messages

[](#location-messages)

```
$phone = '1234567890'; // Phone number in E.164 format
$longitude = -122.431297;
$latitude = 37.773972;
$locationName = 'Golden Gate Bridge';
$locationAddress = 'Golden Gate Bridge, San Francisco, CA, USA';

$response = $whatsappSender->sendLocationMessage($phone, $longitude, $latitude, $locationName, $locationAddress);
```

### Contact Messages

[](#contact-messages)

```
$phone = '1234567890'; // Phone number in E.164 format
$contacts = [
        [
            "addresses" => [
                [
                    "street" => "STREET",
                    "city" => "CITY",
                    "state" => "STATE",
                    "zip" => "ZIP",
                    "country" => "COUNTRY",
                    "country_code" => "COUNTRY_CODE",
                    "type" => "HOME"
                ],
                [
                    // Additional addresses
                ]
            ],
            "birthday" => "1980-01-01",
            "emails" => [
                [
                    "email" => "EMAIL",
                    "type" => "WORK"
                ],
                // Additional emails
            ],
            "name" => [
                "formatted_name" => "NAME",
                "first_name" => "FIRST_NAME",
                "last_name" => "LAST_NAME",
                "middle_name" => "MIDDLE_NAME",
                "suffix" => "SUFFIX",
                "prefix" => "PREFIX"
            ],
            "org" => [
                "company" => "COMPANY",
                "department" => "DEPARTMENT",
                "title" => "TITLE"
            ],
            "phones" => [
                [
                    "phone" => "PHONE_NUMBER",
                    "type" => "HOME"
                ],
                [
                    "phone" => "PHONE_NUMBER",
                    "type" => "WORK",
                    "wa_id" => "PHONE_OR_WA_ID"
                ]
            ],
            "urls" => [
                [
                    "url" => "URL",
                    "type" => "WORK"
                ],
                // Additional urls
            ]
        ]
    ];

$response = $whatsappSender->sendContactsMessage($phone, $contacts);
```

### Template Messages

[](#template-messages)

```
$phone = '1234567890'; // Phone number in E.164 format
$templateName = 'sample_shipping_confirmation';
$languageCode = 'en_US';
$text = ['7 to 15'];
$response = $whatsappSender->sendTextTemplateMessage($phone, $templateName, $languageCode, $text);
```

### Upload Media

[](#upload-media)

```
$filePath = public_path('images/demo.jpg');
$mimeType = 'image/jpeg';
$response = $whatsappSender->uploadMedia($filePath, $mimeType);
```

### 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)

- [Dog From The Moon](https://github.com/dogfromthemoon)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

Laravel Package Boilerplate
---------------------------

[](#laravel-package-boilerplate)

This package was generated using the [Laravel Package Boilerplate](https://laravelpackageboilerplate.com).

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance53

Moderate activity, may be stable

Popularity17

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity12

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/3f4569cfddd0bb4095e7b9b97d1e44d01dc644f650cf769100f46f7118c4fdea?d=identicon)[porrello](/maintainers/porrello)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/dogfromthemoon-laravel-whatsapp-sender/health.svg)

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

###  Alternatives

[tijsverkoyen/css-to-inline-styles

CssToInlineStyles is a class that enables you to convert HTML-pages/files into HTML-pages/files with inline styles. This is very useful when you're sending emails.

5.8k505.3M227](/packages/tijsverkoyen-css-to-inline-styles)[minishlink/web-push

Web Push library for PHP

1.9k12.0M53](/packages/minishlink-web-push)[laravel-notification-channels/twilio

Provides Twilio notification channel for Laravel

2587.7M12](/packages/laravel-notification-channels-twilio)[spatie/url-signer

Generate a url with an expiration date and signature to prevent unauthorized access

4422.3M16](/packages/spatie-url-signer)[mattketmo/email-checker

Throwaway email detection library

2742.0M5](/packages/mattketmo-email-checker)[laravel-notification-channels/discord

Laravel notification driver for Discord.

2371.3M11](/packages/laravel-notification-channels-discord)

PHPackages © 2026

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