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.
composer require plus config. The decision shifts from "do we have 4–6 engineer-weeks for a messaging channel?" to "which backend(s) do we enable and when do we ship?"whatsapp-web.js sidecar for capabilities Cloud API structurally cannot provide: personal-number pairing, groups, status/stories, and free-form messages outside the 24-hour window. That is a genuine feature unlock for support/ops workflows (group-based coordination, personal-number outreach), not just an implementation detail — but it carries a ToS gray-area and ban risk that must be an explicit, owner-assigned product decision, not an engineering default./whatsapp (dashboard, sessions/QR, compose, conversations with media/ack ticks/search, groups, contacts, webhook log, health), Eloquent models WaSession/WaMessage/WaContact, queued SendMessage job, broadcasting hooks, and CLI lifecycle. That's a whole internal ops console — useful for support teams, but it's also a second UI inside your app that you'll need to auth-wrap and maintain.WhatsApp::send() auto-routing by recipient shape is a nice DX win that keeps call sites backend-agnostic — useful if you want to start on Cloud API and add the sidecar later without rewriting.Adopt when:
/whatsapp/* with your own middleware.whatsapp:web:listen process under Supervisor/systemd — one process per session.Look elsewhere / don't adopt when:
Adoption conditions to set upfront: strong WHATSAPP_WEB_TOKEN and WHATSAPP_APP_SECRET, UI route behind your auth middleware, sidecar bound to 127.0.0.1, whatsapp:health --exit-code wired into monitoring, and an explicit decision recorded on whether the sidecar is allowed at all.
To executives: "We can add a WhatsApp channel — the thing customers actually use — in days instead of a quarter. It gives us two modes: the official Meta API for compliant, scalable notifications, and a personal-number mode that unlocks groups and open conversations official APIs don't allow. It ships with an internal console so support can see and reply to messages without new tooling. Cost is low (MIT license, no vendor fees). The trade-off to decide on: the personal-number mode is unofficial and carries a ban risk and an ongoing maintenance tail, so it's opt-in per use case, not a default. Recommendation: enable Cloud API first for transactional messaging, pilot the sidecar for internal ops, and hold any bulk-campaign feature until rate-limited sending lands."
To engineering: "One composer require gives us a pure-PHP Cloud API client (templates, media, business profile, phone numbers, HMAC-verified webhooks), a bundled ~300-LOC whatsapp-web.js sidecar for personal-number/groups/status/free-form, and a single WhatsApp:: facade with send() auto-routing by recipient shape — so call sites stay backend-agnostic and we can start on Cloud API and add the sidecar without rewriting. We also get Eloquent models, a queued SendMessage job with sensible retry semantics (no retry on permanent Meta errors), broadcasting, a Livewire/Flux admin UI with three CSS install modes (including standalone, zero-build), and CLI lifecycle + whatsapp:health --json for monitoring. We need to budget production ops: Node + Chromium (~600 MB), sidecar under Supervisor, one whatsapp:web:listen per session, UI behind our auth middleware. Known gaps to plan around: bulk send with rate limiting, native Echo listeners, template-builder UI. Risk note: 1.0.3 was a resilience fix for WhatsApp Web minifying its internals — expect the sidecar to need periodic attention, so keep the facade abstraction clean and Cloud API as the stable default."
How can I help you explore Laravel packages today?