{"id":2613,"date":"2026-07-04T10:25:12","date_gmt":"2026-07-04T10:25:12","guid":{"rendered":"https:\/\/justfineinfotech.com\/laravel-whatsapp-two-backends-behind-one-facade-laravel-news\/"},"modified":"2026-07-04T10:25:17","modified_gmt":"2026-07-04T10:25:17","slug":"laravel-whatsapp-two-backends-behind-one-facade-laravel-news","status":"publish","type":"post","link":"https:\/\/justfineinfotech.com\/fr\/laravel-whatsapp-two-backends-behind-one-facade-laravel-news\/","title":{"rendered":"Laravel WhatsApp: Two Backends Behind One Facade &#8211; Laravel News"},"content":{"rendered":"<p><a href=\"https:\/\/github.com\/kstmostofa\/laravel-<a href=\"https:\/\/justfineinfotech.com\/what-is-a-microsoft-copilot-certification\/\" title=\"What Is a Microsoft Copilot Certification?\">what<\/a>sapp&#8221; rel=&#8221;nofollow noopener&#8221; target=&#8221;_blank&#8221;>Laravel WhatsApp<\/a> is a package by <a href=\"https:\/\/github.com\/kstmostofa\" rel=\"nofollow noopener\" target=\"_blank\">Md Mostafijur Rahman<\/a> for sending and receiving WhatsApp messages from a Laravel application. What sets it apart is that it speaks to WhatsApp two different ways: through Meta&#8217;s official Cloud API for business messaging, and through an unofficial Node-based <a href=\"https:\/\/github.com\/pedroslopez\/whatsapp-web.js\" rel=\"nofollow noopener\" target=\"_blank\"><code>whatsapp-web.js<\/code><\/a> sidecar that uses headless Chromium to speak to the same WebSocket protocol as the WhatsApp Web app for a personal account. Both sit behind the same <code>WhatsApp::<\/code> facade, so application code does not need to know which one is handling a given message. It supports Laravel 11, 12, and 13 on PHP 8.2 or higher.<\/p>\n<p>The two backends exist because they are good at different things, and the package is upfront about the trade-offs. The Cloud API is the supported path for templated business messages, but it restricts free-form replies to a 24-hour window and offers no group support. The web sidecar has no such limits and can create groups, post status updates, and pair through a QR code, but it runs against a personal account without official backing.<\/p>\n<table>\n<thead>\n<tr>\n<th>Capability<\/th>\n<th>Cloud API<\/th>\n<th>Web Sidecar<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>QR pairing<\/td>\n<td>No<\/td>\n<td>Yes<\/td>\n<\/tr>\n<tr>\n<td>Groups<\/td>\n<td>No<\/td>\n<td>Yes<\/td>\n<\/tr>\n<tr>\n<td>Free-form messaging<\/td>\n<td>24h template window<\/td>\n<td>Yes<\/td>\n<\/tr>\n<tr>\n<td>Business templates<\/td>\n<td>Yes<\/td>\n<td>No<\/td>\n<\/tr>\n<tr>\n<td>Official support<\/td>\n<td>Yes<\/td>\n<td>Unofficial<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>Sending through either backend<\/h2>\n<p>The simplest call routes a plain text message. The recipient format decides where it goes: an E.164 phone number runs through the Cloud API, while a @c.us identifier targets the web session<\/p>\n<pre><code>WhatsApp::send('+14155550123','Your Laravel News digest is ready to read.');\nWhatsApp::send('14155550123@c.us','Thanks for subscribing to the newsletter!');<\/code><\/pre>\n<p>For business messaging, you reach for the Cloud API&#8217;s template support directly, passing the template name, locale, and parameter components:<\/p>\n<pre><code>WhatsApp::messages()-&gt;sendTemplate('+14155550123','issue_published','en_US', [\n['type'=&gt;'body','parameters'=&gt;[['type'=&gt;'text','text'=&gt;'Issue #312']]],\n]);<\/code><\/pre>\n<p>The web backend exposes operations that the Cloud API cannot perform. Sessions are named, so you can run more than one personal account and address each by name:<\/p>\n<pre><code>WhatsApp::web('main')-&gt;groups()-&gt;create('Laracon Attendees', ['14155550123@c.us']);\nWhatsApp::web('main')-&gt;messages()-&gt;sendImage('14155550123@c.us',\n['url'=&gt;'https:\/\/example.com\/laracon-schedule.png','caption'=&gt;'See you at the keynote!']);<\/code><\/pre>\n<h2>Queued sends and inbound events<\/h2>\n<p>Outbound messages can be dispatched as jobs through the package&#8217;s <code>SendMessage<\/code> job, which keeps message sending off the request cycle and onto your queue workers:<\/p>\n<pre><code>SendMessage::dispatch('+14155550123','New on Laravel News: this week in the ecosystem.');<\/code><\/pre>\n<p>Inbound messages from the sidecar are bridged into Laravel&#8217;s event system. A long-running <code>whatsapp:web:listen<\/code> process watches the Node sidecar and fires typed events such as <code>MessageReceived<\/code>, which you can subscribe to like any other event:<\/p>\n<pre><code>useKstmostofaLaravelWhatsAppEventsWebMessageReceived;\n\u00a0\nEvent::listen(MessageReceived::class,\nfunction($event) {\nLog::info('Reader replied', ['from'=&gt;$event-&gt;from(),'body'=&gt;$event-&gt;body()]);\n}\n);<\/code><\/pre>\n<p>The Cloud API side handles inbound traffic pp secret<\/p>\n<h2>The admin UI and persistence layer<\/h2>\n<p>If you install the optional Livewire and Flux dependencies, the package mounts an admin interface at \/whatsapp. It includes a dashboard, a messaging screen, conversation views rendered as chat bubbles, and pages for groups, contacts, and webhook logs. With Laravel Reverb added, the conversation views update in real time<\/p>\n<figure>\n<img decoding=\"async\" src=\"https:\/\/justfineinfotech.com\/wp-content\/uploads\/2026\/07\/3zF1IeTd2GbeaMuBJZ76u27aeim9K4z1SqZrtKlA-scaled.png\" alt=\"Laravel WhatsApp Admin UI Overview\"><figcaption>Laravel WhatsApp Admin UI Overview<\/figcaption><\/figure>\n<figure>\n<img decoding=\"async\" src=\"https:\/\/justfineinfotech.com\/wp-content\/uploads\/2026\/07\/1tfHcwIWov8QHoKTZu3j2yc22IKWdjGLFrpFwEfN-scaled.png\" alt=\"Laravel WhatsApp Admin UI Compose Message screen\"><figcaption>Laravel WhatsApp Admin UI Compose Message screen<\/figcaption><\/figure>\n<p>Persistence is opt-in through three Eloquent models: WaSession, WaMessage, and WaContact. These can live on a separate database connection if you would rather keep WhatsApp data out of your primary schema. The package also handles background event bridging, session health monitoring, and avatar and <a href=\"https:\/\/justfineinfotech.com\/what-is-a-social-media-marketer-and-how-to-become-one\/\" title=\"What Is a Social Media Marketer? And How to Become One\">media<\/a> caching<\/p>\n<h2>Getting started<\/h2>\n<p>Install the package and publish its config and migrations:<\/p>\n<pre><code>composerrequirekstmostofa\/laravel-whatsapp\nphpartisanvendor:publish--tag=laravel-whatsapp-config\nphpartisanvendor:publish--tag=laravel-whatsapp-migrations\nphpartisanmigrate<\/code><\/pre>\n<p>The Cloud API path needs your Meta credentials in the environment:<\/p>\n<pre><code>WHATSAPP_ACCESS_TOKEN=EAAG...\nWHATSAPP_PHONE_NUMBER_ID=123456789012345\nWHATSAPP_BUSINESS_ACCOUNT_ID=987654321098765\nWHATSAPP_APP_SECRET=your-meta-app-secret\nWHATSAPP_VERIFY_TOKEN=any-string-you-make-up<\/code><\/pre>\n<p>The web sidecar is installed and started through artisan commands, after which a listener process bridges its events back into Laravel:<\/p>\n<pre><code>phpartisanwhatsapp:sidecar:install\nphpartisanwhatsapp:sidecar:start\nphpartisanwhatsapp:web:listenmain&amp;<\/code><\/pre>\n<p>You can read the e commands on GitHub<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/justfineinfotech.com\/wp-content\/uploads\/2026\/07\/d2e1d15c9ca048ffff35a1ba26047471.jpg\" alt=\"Yannick Lyn Fatt photo\">    <\/p>\n<p>Staff Writer at Laravel News and Full stack web developer<\/p>\n<p>Filed in:<\/p>\n<div style=\"clear:both;margin:30px 0 15px 0\">\n<p>\n    <strong>Related:<\/strong><br \/>\n    <a href=\"https:\/\/yoursite.com\/automation-training-benin\/\" title=\"Digital Automation Training Benin: 5 Winning Skills Employers Demand in 2026\" target=\"_blank\" rel=\"noopener\"><br \/>\n      Digital Automation Training Benin: 5 Winning Skills Employers Demand in 2026<br \/>\n    <\/a>\n  <\/p>\n<p>\n    <a href=\"https:\/\/yoursite.com\/automation-africa\/\" title=\"WhatsApp Marketing Automation Africa: 6 Dangerous Mistakes Brands Make in Nigeria\" target=\"_blank\" rel=\"noopener\"><br \/>\n      WhatsApp Marketing Automation Africa: 6 Dangerous Mistakes Brands Make in Nigeria<br \/>\n    <\/a>\n  <\/p>\n<\/div>\n<div style=\"clear:both;margin:30px 0;padding:25px;background:#f8f9fc;border:1px solid #ddd;border-radius:8px;text-align:center\">\n<h3>Want to learn this practically?<\/h3>\n<p>Join <strong>Justfine Infotech<\/strong> and build real <a href=\"https:\/\/justfineinfotech.com\/10000-literacy-educators-worldwide-empowered-through-digital-skills-training\/\" title=\"10,000 literacy educators worldwide empowered through digital skills training\">digital skills<\/a> in AI, automation, web development, digital marketing, office productivity, e-commerce, freelancing and cybersecurity.<\/p>\n<p><strong>Available Programmes:<\/strong><br \/>\n  6 Weeks Certificate \u2022 3 Months Professional Certificate \u2022 6 Months Diploma \u2022 Full Professional Diploma<\/p>\n<p><strong>WhatsApp:<\/strong><br \/>\n  +229 01 57 57 99 15<br \/>\n  +229 01 66 68 11 60<\/p>\n<p><a href=\"https:\/\/api.whatsapp.com\/send?phone=2348132690270&amp;text=Hello\" target=\"_blank\" rel=\"noopener\">Enroll Now<\/a><\/p>\n<\/div>\n<p class=\"ani-source\">Source: <a href=\"https:\/\/laravel-news.com\/laravel-whatsapp-two-backends-behind-one-facade\" target=\"_blank\" rel=\"nofollow noopener\">laravel-news.com<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Laravel WhatsApp is a package by Md Mostafijur Rahman for sending and receiving WhatsApp messages from a Laravel application. What sets it apart is that it speaks to WhatsApp two different ways: through Meta&#8217;s official Cloud API for business messaging, and through an unofficial Node-based whatsapp-web.js sidecar that uses headless Chromium to speak to the&hellip;<\/p>","protected":false},"author":1,"featured_media":2618,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[65],"tags":[131,132,133,130,105],"class_list":["post-2613","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-whatsapp-business-sme-growth","tag-backends","tag-behind","tag-facade","tag-laravel","tag-whatsapp"],"_links":{"self":[{"href":"https:\/\/justfineinfotech.com\/fr\/wp-json\/wp\/v2\/posts\/2613","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/justfineinfotech.com\/fr\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/justfineinfotech.com\/fr\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/justfineinfotech.com\/fr\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/justfineinfotech.com\/fr\/wp-json\/wp\/v2\/comments?post=2613"}],"version-history":[{"count":1,"href":"https:\/\/justfineinfotech.com\/fr\/wp-json\/wp\/v2\/posts\/2613\/revisions"}],"predecessor-version":[{"id":2617,"href":"https:\/\/justfineinfotech.com\/fr\/wp-json\/wp\/v2\/posts\/2613\/revisions\/2617"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/justfineinfotech.com\/fr\/wp-json\/wp\/v2\/media\/2618"}],"wp:attachment":[{"href":"https:\/\/justfineinfotech.com\/fr\/wp-json\/wp\/v2\/media?parent=2613"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/justfineinfotech.com\/fr\/wp-json\/wp\/v2\/categories?post=2613"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/justfineinfotech.com\/fr\/wp-json\/wp\/v2\/tags?post=2613"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}