Weave 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

kstmostofa/laravel-whatsapp

Dual-backend WhatsApp for Laravel: a pure-PHP Meta Cloud API client plus a whatsapp-web.js sidecar for personal-number access, unified under one WhatsApp:: facade, with a Livewire admin UI, Eloquent models, webhooks, and health checks.

View on GitHub
Deep Wiki
Context7

Dual-backend Laravel package for WhatsApp: Meta Cloud API + bundled whatsapp-web.js sidecar. Ships a Livewire/Flux admin UI, queued jobs, webhooks with HMAC, Eloquent models, broadcasting, and CLI lifecycle commands.

Frequently asked questions about Laravel Whatsapp
How do I install kstmostofa/laravel-whatsapp in a Laravel app?
Install it with Composer using composer require kstmostofa/laravel-whatsapp. Publish the package config and migrations with the vendor:publish tags shown in the README, then run php artisan migrate. Configure either Meta Cloud API credentials or the whatsapp-web.js sidecar URL in your .env file, depending on which backend you plan to use.
Does laravel-whatsapp support both Meta Cloud API and whatsapp-web.js?
Yes, it is a dual-backend package with a Meta Cloud API client in pure PHP and a bundled whatsapp-web.js sidecar for personal-account access. Both are exposed through one WhatsApp facade, and WhatsApp::send can auto-pick a backend. Use Cloud API for templates, media, business profile, and HMAC webhooks; use the sidecar for QR pairing, groups, status, contacts, and free-form messages.
What Laravel and PHP versions does this WhatsApp package require?
The package is positioned for Laravel 10+ and PHP 8.1+. The Livewire admin UI is optional from a stack perspective, but using that bundled UI requires Livewire. Check the Packagist badges and README for the latest supported constraints before upgrading.
Do I need Livewire to use the bundled WhatsApp admin UI?
The bundled admin UI is a Livewire feature, so using that UI requires Livewire in your Laravel app. The core WhatsApp facade, queued jobs, webhooks, and Eloquent models can be used without adopting the admin UI. If your frontend stack avoids Livewire, plan to build custom screens or skip the package UI.
How does laravel-whatsapp send messages asynchronously with Laravel queues?
The package includes queued jobs such as WhatsAppMessageJob so WhatsApp sends can run through Laravel's queue system instead of blocking requests. Configure a queue driver and worker as you would for any Laravel queued job. Dispatch the package job or call the facade from your own job when you need retries, throttling, or background processing.
How are Meta Cloud API webhooks secured in laravel-whatsapp?
The Cloud API webhook handling supports HMAC verification using your Meta app secret, along with a verify token for webhook setup. Set WHATSAPP_APP_SECRET and WHATSAPP_VERIFY_TOKEN in .env and expose an HTTPS endpoint. For production, also add idempotency, retry handling, and monitoring because HTTP webhooks can fail or be delivered more than once.
What is required to run the whatsapp-web.js sidecar in production?
You need a persistent Node sidecar process running whatsapp-web.js, plus QR pairing and session storage so the WhatsApp session survives restarts. Run it under Docker, Kubernetes, systemd, or another process supervisor and monitor it like any long-running service. Use the whatsapp:web:listen daemon to turn sidecar SSE events into Laravel events. Because WhatsApp Web internals can change, keep the sidecar updated and test after upgrades.
Can I use my personal WhatsApp number instead of a Meta business account?
Yes, the whatsapp-web.js sidecar is intended for personal-number QR pairing and supports groups, status, contact lookup, and free-form messages. That avoids Meta business verification and template restrictions but adds sidecar operations and session-management work. It also carries more risk from WhatsApp Web changes, which the package mitigates but cannot eliminate.
Does the package include database models and migrations for messages and contacts?
Yes, it ships opt-in Eloquent models such as WaSession, WaMessage, and WaContact with publishable migrations. You can use a separate database connection via WHATSAPP_DB_CONNECTION if you do not want WhatsApp tables in your main database. Review the schema for soft deletes or archiving needs; the v1.0.3 insert-vs-upsert fix is a data-integrity change and does not require new migrations.
How can I monitor or test the WhatsApp integration?
Use php artisan whatsapp:health --json for CI or monitoring and the package status page for a human-readable health check. Test queued sending with a non-production queue worker and exercise webhook HMAC verification with sample payloads. For the sidecar, verify QR/session state and rerun tests after dependency updates because upstream WhatsApp Web changes can affect behavior.
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.
takashato/laravel-vietqr
aitor24/laralang
kraenzle-ritter/entity-relations
dindigital/din-image
pomirleanu/image-colors
sawmainek/laravel-api-generator
delatbabel/jsonresponses
mouhamedfd/permissions-generator
eduplus/qr
laravel2580/idehelpers
delatbabel/viewpages
anavel/gettext
muhamadrezaar/highcharts
delatbabel/keylists
frankkessler/salesforce-laravel-oauth2-rest
anavel/foundation
wdmtech/enviricons
eii/laravel-captcha
muka/shape-reader
tdt/json