PHPackages                             darkclow4/laravel-waha-messages - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. darkclow4/laravel-waha-messages

ActiveLibrary

darkclow4/laravel-waha-messages
===============================

Laravel integration package for WAHA (WhatsApp HTTP API)

v1.0.0(1mo ago)00MITPHPPHP ^8.3

Since Mar 27Pushed 1mo agoCompare

[ Source](https://github.com/darkclow4/laravel-waha-messages)[ Packagist](https://packagist.org/packages/darkclow4/laravel-waha-messages)[ Docs](https://github.com/darkclow4/laravel-waha-messages)[ RSS](/packages/darkclow4-laravel-waha-messages/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)

Laravel WAHA Messages
=====================

[](#laravel-waha-messages)

A Laravel package for seamless integration with [WAHA (WhatsApp HTTP API)](https://waha.devlike.pro/). Send messages, manage sessions, handle groups, contacts, and chats — all through a clean, fluent API.

Warning

**Unofficial API Notice**WAHA is an unofficial WhatsApp API. Please use this package responsibly. Sending messages too quickly, sending spam, or violating WhatsApp's Terms of Service may result in your WhatsApp number being permanently banned or blocked by Meta. Use at your own risk.

Requirements
------------

[](#requirements)

- PHP 8.3+
- Laravel 11.x or above
- A running [WAHA](https://github.com/devlikeapro/waha) instance

Installation
------------

[](#installation)

Add the package to your Laravel project:

```
composer require darkclow4/laravel-waha-messages
```

The service provider and facade are auto-discovered. To publish the config file:

```
php artisan vendor:publish --tag=waha-config
```

Configuration
-------------

[](#configuration)

Add the following to your `.env` file:

```
WAHA_URL=http://localhost:3000
WAHA_API_KEY=your-api-key
WAHA_SESSION=default
WAHA_TIMEOUT=30
WAHA_CONNECT_TIMEOUT=10
WAHA_RETRY_TIMES=3
WAHA_RETRY_SLEEP=100
```

VariableDescriptionDefault`WAHA_URL`Base URL of your WAHA server`http://localhost:3000``WAHA_API_KEY`API key for authentication`null``WAHA_SESSION`Default session name`default``WAHA_TIMEOUT`Request timeout (seconds)`30``WAHA_CONNECT_TIMEOUT`Connection timeout (seconds)`10``WAHA_RETRY_TIMES`Number of retry attempts`3``WAHA_RETRY_SLEEP`Delay between retries (ms)`100`Quick Start
-----------

[](#quick-start)

```
use LaravelWaha\WahaMessages\Facades\Waha;

// Send a text message
Waha::messages()->sendText('1111111111111@c.us', 'Hello from Laravel!');
```

Usage
-----

[](#usage)

### Sending Messages

[](#sending-messages)

#### Text Message

[](#text-message)

```
Waha::messages()->sendText('1111111111111@c.us', 'Hello World!');

// With a specific session
Waha::messages()->sendText('1111111111111@c.us', 'Hello!', 'my-session');
```

#### Image Message

[](#image-message)

```
Waha::messages()->sendImage(
    chatId: '1111111111111@c.us',
    url: 'https://example.com/photo.jpg',
    caption: 'Check out this image!',
);
```

#### Video Message

[](#video-message)

```
Waha::messages()->sendVideo(
    chatId: '1111111111111@c.us',
    url: 'https://example.com/video.mp4',
    caption: 'Watch this video!',
);
```

#### File / Document Message

[](#file--document-message)

```
Waha::messages()->sendFile(
    chatId: '1111111111111@c.us',
    url: 'https://example.com/report.pdf',
    filename: 'monthly-report.pdf',
);
```

#### Location Message

[](#location-message)

```
Waha::messages()->sendLocation(
    chatId: '1111111111111@c.us',
    latitude: -6.200000,
    longitude: 106.816666,
    title: 'Jakarta',
);
```

#### Contact vCard

[](#contact-vcard)

```
Waha::messages()->sendContact(
    chatId: '1111111111111@c.us',
    contact: [
        'fullName' => 'John Doe',
        'phoneNumber' => '+1111111111111',
    ],
);
```

#### Mark as Seen

[](#mark-as-seen)

```
Waha::messages()->sendSeen('1111111111111@c.us');
```

#### Typing Indicator

[](#typing-indicator)

```
// Start typing
Waha::messages()->startTyping('1111111111111@c.us');

// Stop typing
Waha::messages()->stopTyping('1111111111111@c.us');
```

---

### Human-Like Messaging

[](#human-like-messaging)

Send messages that simulate real human behavior. The flow automatically executes in this order:

1. **Mark as seen** — Read receipt appears on the chat
2. **Start typing** — Typing indicator shows up
3. **Delay** — Waits based on the message character count
4. **Stop typing** — Typing indicator disappears
5. **Send message** — The actual message is delivered

```
// Basic usage
Waha::humanLike()->sendText('1111111111111@c.us', 'Hello!');

// With a specific session
Waha::humanLike()->sendText('1111111111111@c.us', 'Hello!', 'my-session');
```

#### Configuring Typing Speed

[](#configuring-typing-speed)

You can fine-tune the typing delay using a fluent API:

```
Waha::humanLike()
    ->msPerChar(100)     // 100ms per character (default: 300)
    ->minDelay(1000)     // Minimum 1 second delay (default: 2000ms)
    ->maxDelay(15000)    // Maximum 15 second delay (default: 10000ms)
    ->sendText('1111111111111@c.us', 'This message will take longer to "type"...');
```

OptionDescriptionDefault`msPerChar(int)`Milliseconds per character`300``minDelay(int)`Minimum delay in ms`2000``maxDelay(int)`Maximum delay in ms`10000`> **Tip:** A short message like "Hi!" (3 chars × 300ms = 900ms) will use the `minDelay` instead. A very long message will be capped at `maxDelay`.

---

### Session Management

[](#session-management)

```
// List all sessions
$sessions = Waha::sessions()->list();

// Create a new session
Waha::sessions()->create(['name' => 'my-session']);

// Start / Stop / Logout
Waha::sessions()->start('my-session');
Waha::sessions()->stop('my-session');
Waha::sessions()->logout('my-session');

// Get session details
$session = Waha::sessions()->get('my-session');

// Get QR code for authentication
$qr = Waha::sessions()->qr('my-session');

// Request authentication code
Waha::sessions()->requestCode('my-session', [
    'phoneNumber' => '1111111111111',
]);

// Update a session
Waha::sessions()->update('my-session', ['webhooks' => [...]]);

// Delete a session
Waha::sessions()->delete('my-session');
```

---

### Chat Management

[](#chat-management)

```
// Get chats overview
$chats = Waha::chats()->overview();

// Get messages from a specific chat
$messages = Waha::chats()->messages('1111111111111@c.us', limit: 50);

// Delete a chat
Waha::chats()->deleteChat('1111111111111@c.us');

// Use a specific session
$chats = Waha::chats()->overview('my-session');
```

---

### Group Management

[](#group-management)

```
// List all groups
$groups = Waha::groups()->list();

// Create a group
Waha::groups()->create('Project Team', [
    '1111111111111@c.us',
    '1111111111112@c.us',
]);

// Get group details
$group = Waha::groups()->get('120363001234567890@g.us');

// Add participants
Waha::groups()->addParticipants('120363001234567890@g.us', [
    '1111111111113@c.us',
]);

// Remove participants
Waha::groups()->removeParticipants('120363001234567890@g.us', [
    '1111111111113@c.us',
]);
```

---

### Contact Management

[](#contact-management)

```
// List all contacts
$contacts = Waha::contacts()->list();

// Get a specific contact
$contact = Waha::contacts()->get('1111111111111@c.us');

// Check if a phone number exists on WhatsApp
$result = Waha::contacts()->checkExists('1111111111111');
// Returns: ['numberExists' => true, 'chatId' => '1111111111111@c.us']

// Get profile picture URL
$picture = Waha::contacts()->profilePicture('1111111111111@c.us');
```

---

### Using the Client Directly

[](#using-the-client-directly)

You can also inject `WahaClient` directly via dependency injection:

```
use LaravelWaha\WahaMessages\WahaClient;

class NotificationService
{
    public function __construct(
        private WahaClient $waha,
    ) {}

    public function sendAlert(string $phone, string $message): void
    {
        $this->waha->messages()->sendText("{$phone}@c.us", $message);
    }
}
```

Error Handling
--------------

[](#error-handling)

The package throws specific exceptions for API errors:

```
use LaravelWaha\WahaMessages\Exceptions\WahaException;
use LaravelWaha\WahaMessages\Exceptions\WahaAuthenticationException;
use LaravelWaha\WahaMessages\Exceptions\WahaNotFoundException;

try {
    Waha::sessions()->get('non-existent');
} catch (WahaNotFoundException $e) {
    // Session not found (404)
    $e->getStatusCode();    // 404
    $e->getResponseBody();  // ['message' => '...']
} catch (WahaAuthenticationException $e) {
    // Invalid API key (401)
} catch (WahaException $e) {
    // Any other API error
}
```

Chat ID Format
--------------

[](#chat-id-format)

WAHA uses the following chat ID formats:

TypeFormatExampleIndividual`{phone}@c.us``1111111111111@c.us`Group`{id}@g.us``120363001234567890@g.us`> **Note:** Phone numbers should include the country code without the `+` prefix.

License
-------

[](#license)

MIT

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance90

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

47d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/54412655?v=4)[Muhammad Irfan Muttaqin](/maintainers/darkclow4)[@darkclow4](https://github.com/darkclow4)

---

Top Contributors

[![darkclow4](https://avatars.githubusercontent.com/u/54412655?v=4)](https://github.com/darkclow4 "darkclow4 (3 commits)")

---

Tags

laravelmessagingwhatsappwaha

### Embed Badge

![Health badge](/badges/darkclow4-laravel-waha-messages/health.svg)

```
[![Health](https://phpackages.com/badges/darkclow4-laravel-waha-messages/health.svg)](https://phpackages.com/packages/darkclow4-laravel-waha-messages)
```

###  Alternatives

[tzsk/sms

A robust and unified SMS gateway integration package for Laravel, supporting multiple providers.

320244.3k6](/packages/tzsk-sms)[api-platform/laravel

API Platform support for Laravel

59126.4k6](/packages/api-platform-laravel)[kerigard/laravel-lang-ru

Ru lang for Laravel

2116.8k](/packages/kerigard-laravel-lang-ru)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
