Skip to content

Getting Started

Laravel WAHA is an opinionated Laravel package for interacting with the WAHA API.

Requirements

VersionPHPComposerLaravel
1.x>= 8.4Required>= 12.x

IMPORTANT

This package supports Laravel package auto-discovery - no need to register the service provider.

Installation

You can install the package via Composer:

bash
composer require njoguamos/laravel-waha

Environment variables

  • WAHA_API_KEY – Your WAHA API key
  • WAHA_BASE_URL – Base API URL (default https://waha.example.com)
  • WAHA_SESSION – Default WhatsApp session name (default default)
  • WAHA_ENGINE – Engine type: WEBJS, GOWS, or NOWEB (default GOWS)
dotenv
WAHA_API_KEY=your-api-key
WAHA_BASE_URL=https://waha.example.com
WAHA_SESSION=default
WAHA_ENGINE=GOWS

Configuration

You can publish the waha.php configuration by running the following command:

bash
php artisan vendor:publish --tag=config --provider="NjoguAmos\Waha\WahaServiceProvider"
Content of the waha.php
php
return [
    'base_url' => env('WAHA_BASE_URL'),

    'api_key' => env('WAHA_API_KEY'),

    'session' => env('WAHA_SESSION', 'default'),

    'engine' => env('WAHA_ENGINE', 'GOWS'),
];

Engines

WAHA supports different engines with varying features:

EngineDescription
WEBJSConnects via WhatsApp Web using Puppeteer to avoid detection
GOWSConnects directly via WebSocket without requiring a browser
NOWEBConnects directly via WebSocket, saving CPU and memory

See WAHA Engines for more details.

Usage

php
use NjoguAmos\Waha\Facades\Status;
use NjoguAmos\Waha\Dto\TextStatusData;

$statusData = new TextStatusData(
    text: 'Hello from WhatsApp.',
    backgroundColor: '#38b42f',
    font: 1
);

$result = Status::sendText(session: 'default', data: $statusData);

Released under the MIT License.