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

Whatsapi Laravel Package

xaamin/whatsapi

xaamin/whatsapi is a Laravel-friendly wrapper for the WhatsApp Cloud API, making it easy to send text, media, template and interactive messages, verify webhooks, and manage WhatsApp Business resources.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit. xaamin/whatsapi is a thin PHP client over an unofficial WhatsApp Web protocol implementation. It is not a standalone library: it requires a separate Node.js sidecar process (the package docs point at wa-automate-nodejs/whatsapp-web.js-style bridges) that holds the WhatsApp session, exposes an HTTP endpoint, and the PHP package wraps that endpoint in Laravel-flavoured facades, config, and resource classes. For a TPM this means the integration is two runtimes, not one. The PHP side is a convenience layer — request signing, config, a service provider, a few DTOs — and carries no messaging logic itself. Any evaluation should treat the Node bridge as the real dependency and the PHP package as the ergonomic surface over it.

Integration feasibility. Composer-installable, Laravel service provider with publishable config, familiar facade pattern. A competent Laravel engineer can get a "send a text message to a number" proof of concept running in under a day, assuming the Node sidecar is stood up and a QR-code session is authenticated. That low time-to-first-message is the package's main draw and the reason it has any traction. Beyond the happy path — media, groups, webhooks, delivery receipts — the API surface is thin and you will be reading the Node bridge docs to understand what the PHP wrapper is actually forwarding. Feasibility is high for prototypes, moderate for internal tooling, low for anything customer-facing at scale.

Technical risk. This is the dominant concern and should anchor the business case. The package rides an unofficial WhatsApp Web session, which is explicitly outside WhatsApp's Terms of Service for business messaging. Accounts used this way are subject to silent bans, and the ban is on the phone number, not the library — a real operational loss if the number is a business line. The upstream Node library tracks a moving target (WhatsApp Web protocol changes, encryption layer updates) and breaks without warning; the PHP wrapper's release cadence will always lag. 131 stars, MIT, single-maintainer profile: assume best-effort maintenance. Pin versions, vendor the Node sidecar into your own image, and budget for the day the upstream breaks and you have to fix it yourself or migrate to the official WhatsApp Business Cloud API.

Key questions.

  • Is the WhatsApp number disposable, or is it a business asset where a ban is a material risk?
  • Has legal/compliance signed off on using an unofficial WhatsApp client for this use case?
  • Who owns the Node sidecar — same team, or is this a hidden cross-team dependency?
  • What is the exit path to the official WhatsApp Business Cloud API, and how much of the calling code is insulated behind an interface?
  • Does the sidecar need outbound internet, persistent disk for the session store, and a stable single instance? Where does that live?

Integration Approach

Stack fit. Comfortable in a Laravel codebase on PHP 7.4–8.x. The service provider auto-discovery and config publishing match Laravel conventions, so it slots in without bespoke bootstrap. It is a poor fit for non-Laravel PHP and a poor fit for serverless — the sidecar needs a long-lived process with persistent session storage, which rules out typical FaaS deployments. If the application is containerised on ECS/Kubernetes or a VPS, it fits; if it is Lambda or shared hosting, it does not.

Migration path. The realistic starting point is "we are doing this manually" — someone sending WhatsApp messages from a phone, or a homegrown cURL script against the Node bridge. The package replaces the cURL layer with a typed client, which is a genuine cleanup and a low-risk first step. If migrating from another wrapper (muktabd/whatsapi and similar are close relatives), expect near-identical method names and a mechanical swap, but verify the underlying Node bridge version matches — mixing a PHP wrapper from one lineage with a Node bridge from another is a common and confusing failure. Migration away later is the harder direction: wrap every call behind a domain-level NotificationChannel interface from day one so the WhatsApp transport is swappable for the official Cloud API or SMS.

Compatibility. Two axes to pin. PHP/Laravel: check the composer constraints against the app's framework version before committing — older wrapper releases target older Laravel and will not install cleanly on Laravel 11 without a fork. Node bridge: the PHP package's expected request/response contract is versioned implicitly by the Node library it was written against; treat the sidecar image tag as a locked dependency, not a floating latest. WhatsApp protocol drift is the third axis and is outside anyone's control — assume a breakage window measured in days whenever WhatsApp ships a Web update.

Sequencing.

  1. Stand up the Node sidecar in a container, authenticate a test number via QR, confirm a text send end-to-end with curl.
  2. Install the package, publish config, point it at the sidecar, send a message through the facade.
  3. Wrap the facade behind an internal interface (WhatsAppGateway) so callers never touch the package directly.
  4. Add a queue job and retry/backoff around sends; never send inline in a request cycle.
  5. Add observability: log every outbound message with correlation ID, alert on send failures and on session-disconnect events.
  6. Only then move to media, groups, or inbound webhooks, which are materially less reliable than text.
  7. Run in parallel with the incumbent channel for a defined bake period before cutover.

Operational Impact

Maintenance. Two dependency trees, two release cadences, one of which (the Node bridge) is chasing an adversarial protocol. Budget roughly a day per quarter for version bumps and a spike whenever WhatsApp pushes a breaking Web update. The PHP package itself is small enough to vendor or fork if it goes quiet — that is the mitigation, and it should be decided up front rather than discovered during an incident.

Support. No vendor, no SLA, no support contract. Community issues only. For an internal tool this is acceptable; for anything touching customers it is a business-continuity gap that must be named explicitly to stakeholders. Escalation path is "the on-call engineer reads the Node bridge source."

Scaling. Throughput is bounded by a single WhatsApp session per phone number, and unofficial clients are aggressive about rate-limiting and banning accounts that burst. Horizontal scaling means multiple numbers, which means multiple sidecar sessions, which means session state management and a routing layer deciding which number sends which message. This is non-trivial and should be scoped before any volume assumption is baked into a roadmap. Realistic ceiling for a single session is low-volume, human-paced messaging — notifications, alerts, small support flows — not marketing blasts.

Failure modes. Ranked by likelihood and blast radius:

  • Session drop / QR re-auth required — the sidecar loses its session and stops sending until a human scans a QR code. This is the most common operational failure and needs an alert plus a documented re-auth runbook.
  • Number ban — silent, sometimes permanent, and the highest-impact failure. Mitigate with a dedicated disposable number, conservative rate limits, and no unsolicited outbound.
  • Upstream protocol break — library stops working after a WhatsApp Web update; fix is a dependency bump that may not exist yet.
  • Sidecar unavailability — container restart, OOM, disk full on session store; sends fail and queue backs up.
  • Silent delivery failure — message accepted by the sidecar but never delivered; requires delivery-receipt tracking to detect, which the wrapper's support for is limited.

Ramp-up. Low for a Laravel developer to reach first message — half a day with docs. Moderate to operate responsibly — the sidecar, session persistence, re-auth runbook, and queueing are where the real learning sits, and that knowledge should live with whoever owns the deployment, not just the engineer who wrote the integration. Plan a short internal write-up covering sidecar restart, QR re-auth, and how to tell "WhatsApp broke" from "our code broke," because those two incidents look identical from the application logs and the triage path is entirely different.

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.
unabomber/timezone
delatbabel/contacts
astritzeqiri/g-recaptcha
kevinongko/laravel-genode
developeruz/laravel-analytics
robbiep/afterthedeadline
frankkessler/incontact-laravel-oauth2-rest
jlxh/laravel-userlog
davidmgilo/timetables
qylinfly/role-permission
reflect-digital/conduit
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