Looking to hire Laravel developers? Try LaraJobs

laravel-whatsapp-agent maintained by dakeashish1997

Description
WhatsApp package for Laravel using wacli interface
Author
Last update
2026/08/30 15:00 (dev-main)
License
Links
Downloads
1

Comments
comments powered by Disqus

Laravel WhatsApp Agent

A Laravel package to send WhatsApp messages through the wacli binary.

Features

  • Queue-first WhatsApp message processing
  • Send text messages from queued jobs
  • Send files with optional captions from queued jobs
  • wacli status/version command

Requirements

  • PHP ^8.2
  • Laravel application
  • wacli installed and available in your system path

Installation

Install the package in your Laravel app:

composer require dakeashish1997/laravel-whatsapp-agent

Publish configuration:

php artisan vendor:publish --tag=whatsapp-agent-config

Configuration

The package publishes config/whatsapp-agent.php:

return [
    'binary' => env('WA_WACLI_BINARY', 'wacli'),
    'database' => env('WA_WACLI_DATABASE'),
    'store' => env('WA_WACLI_STORE'),
    'timeout' => env('WA_WACLI_TIMEOUT', 60),
];

Example .env values:

WA_WACLI_BINARY=wacli
WA_WACLI_STORE=/absolute/path/to/wacli/store
WA_WACLI_TIMEOUT=60

Usage (Queue Job Only)

Check wacli version

php artisan wacli:version

Queue Job Example

You can dispatch the included job:

use Dakeashish1997\LaravelWhatsappAgent\Jobs\ProcessWhatsappMessage;

// Ask the user/system for the correct JIDs before dispatching the job.
$chatJid = '<correct-chat-jid>'; // e.g. 120363406851126713@g.us
$senderJid = '<correct-sender-jid>'; // e.g. 919175015359@s.whatsapp.net

ProcessWhatsappMessage::dispatch(
    chatJid: $chatJid,
    senderJid: $senderJid,
    senderName: 'Ashish',
    replyMessage: 'Hello from queue',
    attachment: null,
    attachmentCaption: null,
    replyToMsgId: null,
    mentionSender: false,
);

Notes

  • WhatsApp IDs may be phone numbers or full JIDs depending on your flow.
  • Ensure your wacli session is already authenticated and connected.
  • Configure and run a queue worker in your Laravel app.