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 Widget Laravel Package

jeffersongoncalves/laravel-whatsapp-widget

Add a customizable WhatsApp chat widget to any Laravel app. This package offers an easy-to-configure floating button with a pre-filled message, flexible positioning, and simple Blade integration so visitors can start a conversation instantly.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit

  • Conventional Laravel package built on spatie/laravel-package-tools, so it slots into the framework's standard extension model: a service provider registering config, views, migrations, routes, assets, and translations.
  • Rendering is purely Blade-based via two partials (whatsapp-widget-head, whatsapp-widget-body), which matches how most Laravel monoliths and Filament apps compose layouts. No SPA, Livewire, or Inertia coupling.
  • Domain model is a single Eloquent entity, WhatsappAgent (id, active, name, phone, text, image), exposed through two endpoints: a token-guarded JSON listing (/api/whatsapps) and a signed redirect route (/whatsapp-widget/redirect/{whatsapp_agent}) that forwards to wa.me.
  • The design is intentionally thin: a floating button, an agent list panel, a redirect interstitial, and optional cookie-gated audio. There is no admin CRUD surface shipped, so agent management must be owned by the integrating team (Filament resource or custom screen).

Integration feasibility

  • Low-friction install: composer require, publish migrations, php artisan migrate, publish config, include two partials, set WHATSAPP_KEY and FILESYSTEM_DISK. A competent Laravel developer can complete a first render in under an hour.
  • Hard constraints are narrow and modern: PHP 8.2/8.3, Laravel 11/12/13. This is a fit for greenfield or recently upgraded apps, and a blocker for anything on Laravel 10 or PHP 8.1.
  • Asset story needs verification: hasAssets() implies a published vendor asset bundle, so the integration checklist must include the asset publish tag and a check that the widget's CSS/JS actually resolve in the target pipeline.

Technical risk

  • Authentication design is the primary concern. The JSON API authenticates with a static shared secret compared against config('whatsapp-widget.key') and passed as a query parameter (?token=). Query-string secrets leak into access logs, proxies, browser history, and referrers. It is a single global credential with no rotation, scoping, or rate limiting described.
  • PII exposure. The API returns phone, name, and image_url for every active agent. If the token leaks, agent contact details are enumerable.
  • Redirect route trust boundary. The controller resolves WhatsappAgent::where('id', $whatsapp_agent)->firstOrFail() from a string route parameter. Security depends entirely on the signed middleware being applied; that must be confirmed in the route definition, not assumed from the naming.
  • Injection surface in the interstitial. The redirect page writes ww_whatsapp_chat_redirect into a JavaScript variable from agent-supplied phone and text. Free-text fields interpolated into JS require correct escaping or you have stored XSS.
  • Storage misconfiguration. image_url resolves through config('whatsapp-widget.disk'), defaulting to local. On the default disk, avatar URLs will 404 publicly — a silent, cosmetic-only failure that erodes trust in the widget.
  • Project maturity. 9 stars, 0 dependents, single maintainer, and a release date that reads as anomalous for the current window. Bus factor is effectively one. MIT licensing means forking is viable, but it is now your maintenance burden.
  • Verification gaps. Claims of Laravel 13 support, 17+ locales, and an audio cookie flow are documented in an agent skill file rather than upstream docs — treat as intent, not tested behavior.

Key questions

  1. Is the redirect route registered with the signed middleware, and are links permanent or time-limited?
  2. Where does the frontend obtain WHATSAPP_KEY — is it injected into the page, and if so, is it visible to every visitor?
  3. Does the widget call the JSON API client-side, or does it render agents server-side and bypass the token entirely?
  4. Is text escaped before being written into the redirect JavaScript variable?
  5. What is the maintenance posture and release cadence of the upstream repository?
  6. Which publish tags and commands are actually required for assets versus optional for views/config?
  7. Is there any rate limiting, caching, or query scoping on the agents endpoint?

Integration Approach

Stack fit

  • Best fit: server-rendered Laravel applications with Blade layouts, including Filament admin panels where the widget is added to the public-facing layout, not the panel layout.
  • Poor fit: headless/API-only backends, SPAs that would need to reimplement the panel UI, and multi-tenant SaaS where a single global token and a single global agent list are architecturally wrong.
  • Reasonable fit for marketing sites, agencies, and SMB support sites where one or a handful of WhatsApp agents handle inbound traffic.

Migration path

  1. Confirm runtime prerequisites: PHP 8.2+, Laravel 11+, and that the deployment target uses a Vite or equivalent asset build you can publish into.
  2. Install the package and publish the migration, config, and assets. Run the migration on a non-production environment first.
  3. Define the storage strategy before writing any records: set FILESYSTEM_DISK to public or an S3/CDN disk, and confirm Storage::url() produces publicly reachable avatar URLs.
  4. Seed or create WhatsappAgent records; then decide how they will be managed ongoing. The package ships no admin UI, so add a Filament resource or equivalent as a first-class deliverable, not an afterthought.
  5. Add the two Blade partials to the base layout head and body. Verify the widget only renders when active agents exist.
  6. Replace the query-string API credential with a safer consumption pattern, or restrict the endpoint behind network controls and rate limiting.
  7. Publish views to override the redirect template and confirm output escaping for phone and text.

Compatibility

  • Route registration, migration naming, and config publishing follow package-tools conventions and should coexist with existing app routes, but the /api/whatsapps path is generic and worth checking for collisions.
  • The shared WHATSAPP_KEY must be added to every environment's secret store and to the config cache workflow; a missing value yields silent 403s rather than a startup error.
  • Translations cover a broad locale set, but verify the app's locale resolution actually reaches the whatsapp-widget::whatsapp-widget.* namespace.

Sequencing

  1. Prerequisites and environment validation.
  2. Install, publish, migrate.
  3. Storage and image configuration.
  4. Admin CRUD for agents (owned workstream).
  5. Layout partials and visual QA across breakpoints and both position values.
  6. Security hardening: token handling, redirect signature check, escaping review.
  7. Localization and accessibility pass.
  8. Production rollout with feature flag and rollback to partial removal.

Operational Impact

Maintenance

  • The package is small enough to audit and to fork. Budget for that: with one maintainer and near-zero adoption, upstream responsiveness to Laravel major-version bumps is unproven, and you will be carrying the upgrade work yourself within a release cycle or two.
  • Pin the version explicitly. The stated release date is inconsistent with the current timeline, which argues for verifying the actual tagged version and its diff rather than trusting metadata.
  • MIT licensing makes an internal fork a legitimate, low-cost contingency. Decide the trigger point for forking now rather than during an incident.

Support

  • No vendor support. Documentation lives largely in a skill/agent file, so internal runbooks must be written by the integrating team: how agents are added, how the key is rotated, what to do when images break.
  • Establish internal ownership. A floating widget on a public site is a customer-facing surface; it cannot be unowned.

Scaling

  • The agents endpoint performs an unindexed-by-default where('active', true) fetch per request. For low traffic this is irrelevant; for high-traffic marketing pages, cache the agent list with a short TTL and invalidate on save.
  • Agent images should sit behind a CDN. The redirect page is lightweight and stateless, so it scales trivially; signed URLs impose no server session cost.
  • The audio cookie is client-side only, so it imposes no backend load but is also unreliable under privacy blockers.

Failure modes

  • Missing or rotated WHATSAPP_KEY produces 403s on the agent listing with no obvious user-facing symptom beyond an empty widget.
  • Disk misconfiguration yields broken avatars with no error surfaced to operators.
  • Unpublished assets yield an unstyled or invisible widget.
  • Malformed phone values produce broken wa.me links — validate E.164 on write.
  • Unescaped text in the redirect template produces stored XSS.
  • Expired signed links break redirects after a user leaves the panel open.
  • Locale fallback gaps render raw translation keys.
  • Privacy settings blocking cookies silently disable the audio nudge.

Ramp-up

  • Very low for a mid-level Laravel developer: hours to first render, roughly a day to production-ready with admin CRUD.
  • TPM effort is concentrated in two places: the security review (token exposure, redirect signing, output escaping) and the ownership decision (who maintains the vendor fork and the agent admin UI).
  • Overall this is a small, well-shaped package with a disproportionate share of its risk in authentication and PII handling rather than in complexity. Approve for adoption with hardening conditions, not as-is.
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.
tequilarapido/trackit
gregsphotography/site-builder-filament
cabaoctavio/laravel-query-log
gregsphotography/site-builder-components
io-digital/clickatell
snowsoft/laravel-admin
oxygen/auth
relicsoftware/barakah-payment-gateway
tobya/work-with-composer
equipc/laravel-email-validator
equipc/laravel-email-database-log
adedsec/nova-translated-labels
wazza/laravel-db-encryption
hokny/laravel-generator
vonsogt/backup
jengo/queues
jeremykenedy/laravel-observability
coleus/frame
thtg88/journalism
filagora/filagora-ai-forums