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.
Architecture fit
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.whatsapp-widget-head, whatsapp-widget-body), which matches how most Laravel monoliths and Filament apps compose layouts. No SPA, Livewire, or Inertia coupling.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.Integration feasibility
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.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
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.phone, name, and image_url for every active agent. If the token leaks, agent contact details are enumerable.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.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.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.Key questions
signed middleware, and are links permanent or time-limited?WHATSAPP_KEY — is it injected into the page, and if so, is it visible to every visitor?text escaped before being written into the redirect JavaScript variable?Stack fit
Migration path
FILESYSTEM_DISK to public or an S3/CDN disk, and confirm Storage::url() produces publicly reachable avatar URLs.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.phone and text.Compatibility
/api/whatsapps path is generic and worth checking for collisions.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.whatsapp-widget::whatsapp-widget.* namespace.Sequencing
position values.Maintenance
Support
Scaling
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.Failure modes
WHATSAPP_KEY produces 403s on the agent listing with no obvious user-facing symptom beyond an empty widget.phone values produce broken wa.me links — validate E.164 on write.text in the redirect template produces stored XSS.Ramp-up
How can I help you explore Laravel packages today?