Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Laravel Whatsapp

Laravel Whatsapp Laravel Package

itsmedudes/laravel-whatsapp

Production-ready Laravel client for WhatsApp Business via Meta Graph. Send messages with a fluent payload builder, support multi-tenant access tokens, automatic retries and logging, plus webhook signature verification. Includes publishable config and migrations.

View on GitHub
Deep Wiki
Context7

At a glance

Frequently asked questions about Laravel Whatsapp
How do I install and set up Laravel WhatsApp (Meta Graph) in my Laravel project?
Run `composer require itsmedudes/laravel-whatsapp`, then publish the config and migrations with `php artisan vendor:publish --tag=meta-config` and `php artisan vendor:publish --tag=meta-migrations`. Run `php artisan migrate` to set up the database tables. Finally, configure `config/meta.php` with your Meta Developer credentials, WhatsApp Business Phone Number ID, and webhook settings.
Does this package support multi-tenant applications with separate WhatsApp tokens per user?
Yes, the package includes built-in multi-tenant token management via the `forUser($userId)` method. This allows you to switch contexts dynamically for each user or tenant, ensuring secure and isolated WhatsApp API access.
How do I send a WhatsApp message using the MessagePayloadBuilder?
Use the `MessagePayloadBuilder` to construct your message payload, such as `MessagePayloadBuilder::text($to, 'Hello!')`. Then pass it to the client with `$client->sendMessage($phoneNumberId, $payload)`. The builder supports text, interactive buttons, and other message types.
What Laravel versions does this package support?
The package is designed for modern Laravel versions (8.x, 9.x, and 10.x). Check the package’s `composer.json` for the exact supported range, as it may evolve with updates. Ensure your Laravel version aligns with the package’s requirements for dependency compatibility.
How does webhook verification work, and how do I handle incoming WhatsApp webhooks?
The package provides a `WebhookVerifier` class to validate incoming webhook signatures using the `verifySignature($payload, $signatureHeader)` method. You’ll need to set up a Laravel route to receive webhooks and use the verifier to confirm authenticity before processing the payload. The package does not handle routing or dispatching; you’ll need to implement that logic in your controller.
Are there automatic retries for failed API requests or rate limits?
Yes, the package includes built-in retry logic for transient failures, such as rate limits or network issues. This ensures more reliable message delivery in production environments. You can configure retry settings in the published config file.
Can I use this package with WhatsApp Cloud API instead of Meta Graph API?
No, this package is specifically built for the **WhatsApp Business API via Meta Graph API**. If you need WhatsApp Cloud API support, you’ll need a different package or solution, as the two APIs have distinct endpoints and requirements.
How do I handle errors or rate limits when sending messages?
The package logs errors and retries failed requests automatically. For rate limits (e.g., Meta’s 240 messages/hour limit), monitor your usage and implement throttling logic in your application. Custom error handling for Meta API responses (e.g., 400 Bad Request) should be added in your application code.
Is there support for async message sending (e.g., queues or jobs) to improve performance?
The package currently uses synchronous `sendMessage()` calls, which may block requests under high load. To improve performance, integrate Laravel queues or jobs to process messages asynchronously. You’ll need to wrap the client calls in a job and dispatch them to a queue.
What are the prerequisites for using this package in production?
You’ll need a **Meta Developer Account**, a **WhatsApp Business Account**, and an approved **Phone Number ID** (sandbox or production). Additionally, set up a webhook endpoint in Meta’s dashboard pointing to your Laravel route, and ensure your server can handle HTTPS requests for webhook verification. The package itself requires minimal additional setup beyond these Meta-specific requirements.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge
l3aro/rating-star-for-filament
leek/filament-subtenant-scope