PHPackages                             zifala/go-whatsapp-laravel - 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. zifala/go-whatsapp-laravel

ActiveLibrary

zifala/go-whatsapp-laravel
==========================

Laravel package for go-whatsapp-web-multidevice using Saloon

v1.0.8(5mo ago)5171MITPHPPHP ^8.1

Since Dec 6Pushed 5mo agoCompare

[ Source](https://github.com/mohaaosman/GoWhatsApp)[ Packagist](https://packagist.org/packages/zifala/go-whatsapp-laravel)[ RSS](/packages/zifala-go-whatsapp-laravel/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (9)Dependencies (7)Versions (10)Used By (0)

GoWhatsApp Laravel Package
==========================

[](#gowhatsapp-laravel-package)

A Laravel wrapper for [go-whatsapp-web-multidevice](https://github.com/aldinokemal/go-whatsapp-web-multidevice) using [Saloon](https://docs.saloon.dev/).

Prerequisites
-------------

[](#prerequisites)

Before using this package, you must have the **go-whatsapp-web-multidevice** server running. This package interacts with its API.

### Setting up the Server

[](#setting-up-the-server)

You can run the server locally using Docker or deploy it to a remote server.

**Run with Docker:**

```
docker run -d \
  --name go-whatsapp \
  -p 3000:3000 \
  -v $(pwd)/whatsapp_files:/usr/src/app/files \
  -e SECRET_KEY=your-secret-key \
  aldinokemal/go-whatsapp-web-multidevice
```

Or using **Docker Compose**:

```
version: '3.9'
services:
  go-whatsapp:
    image: aldinokemal/go-whatsapp-web-multidevice
    ports:
      - "3000:3000"
    volumes:
      - ./whatsapp_files:/usr/src/app/files
    environment:
      - SECRET_KEY=your-secret-key
```

Once running, the API will be available at `http://localhost:3000` (or your server IP).

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

[](#installation)

You can install the package via composer:

```
composer require zifala/go-whatsapp-laravel
```

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

[](#configuration)

Publish the configuration file and migrations:

```
php artisan vendor:publish --tag="go-whatsapp-config"
php artisan vendor:publish --tag="go-whatsapp-migrations"
```

Run migrations to create the `go_whatsapp_devices` and `go_whatsapp_logs` tables:

```
php artisan migrate
```

Set your global defaults in `.env`:

```
GO_WHATSAPP_BASE_URL=http://localhost:3000
GO_WHATSAPP_USERNAME=your-username
GO_WHATSAPP_PASSWORD=your-password
GO_WHATSAPP_LOGGING_ENABLED=true
GO_WHATSAPP_QUEUE_ENABLED=false
GO_WHATSAPP_QUEUE_CONNECTION=sync
GO_WHATSAPP_QUEUE_NAME=default
```

Usage
-----

[](#usage)

### 1. Using the Device Model (Recommended)

[](#1-using-the-device-model-recommended)

The package simplifies device management by providing a helper to get the single active device instance. It automatically checks for an existing device in the database, fetches from the API, or creates one based on your config.

```
use Zifala\GoWhatsApp\Models\GoWhatsAppDevice;

// Retrieve the singleton device instance
$device = GoWhatsAppDevice::getDevice();

// Now you can use all methods
$device->sendMessage('628123456789', 'Hello World');
```

### 2. Using Traits in Your Own Classes

[](#2-using-traits-in-your-own-classes)

You can also use the package's functionality directly in your own classes (e.g., Services, Jobs, Livewire Components) by using the provided traits. The connection will be automatically resolved using your `.env` configuration.

```
namespace App\Services;

use Zifala\GoWhatsApp\Traits\HasSend;
use Zifala\GoWhatsApp\Traits\HasAccount;

class WhatsAppService
{
    use HasSend, HasAccount;

    public function sendWelcomeMessage(string $phone)
    {
        // Helper methods like numberExists and sendMessage are available directly
        if ($this->numberExists($phone)) {
            $this->sendMessage($phone, "Welcome to our platform!");
        }
    }
}
```

### App Management

[](#app-management)

Manage the session and connection state.

```
// List all active sessions/devices on the server
$devices = $device->devices();

// Login with code
$device->loginWithCode('628123456789');

// Login (QR Code flow usually initiated here if supported by API logic)
$device->login();

// Logout
$device->logout();

// Reconnect
$device->reconnect();
```

### Sending Messages

[](#sending-messages)

Send various types of messages easily.

> **Note**: Methods return `true` on success and throw a `RuntimeException` on failure (e.g., WhatsApp error, number not found).

```
// Send Text
$device->sendMessage('628123456789', 'Hello from Laravel!');

// Send Text with Reply
$device->sendMessage('628123456789', 'Replying to you', 'message-id-to-reply');

// Send Image
$device->sendImage('628123456789', '/path/to/image.jpg', 'Cool Image');
// Or via URL
$device->sendImage('628123456789', 'https://example.com/image.jpg', 'Image from URL', imageUrl: 'https://example.com/image.jpg');

// Send File
$device->sendFile('628123456789', '/path/to/document.pdf', 'Here is the doc');

// Send Video
$device->sendVideo('628123456789', '/path/to/video.mp4', 'Check this out');

// Send Audio
$device->sendAudio('628123456789', '/path/to/audio.mp3');

// Send Presence
$device->sendPresence('available'); // or 'unavailable'

// Send Chat Presence (Typing)
$device->sendChatPresence('628123456789', 'composing'); // 'composing', 'paused', 'recording'
```

### Group Management

[](#group-management)

Create and manage groups.

```
// Create Group
$device->createGroup('My Group Name', ['628123456789', '628987654321']);

// Join Group via Link
$device->joinGroupWithLink('https://chat.whatsapp.com/InviteLink...');

// Leave Group
$device->leaveGroup('123456789-123456@g.us');

// Get Group Info
$info = $device->groupInfo('123456789-123456@g.us');
```

### Account Management

[](#account-management)

Manage user account information.

```
// Get User Info
$info = $device->userInfo('628123456789');

// Check if User exists on WhatsApp (Raw Response)
$response = $device->checkUser('628123456789');

// Check if Number Exists (Boolean Helper)
// Returns true if registered on WhatsApp, false otherwise.
$exists = $device->numberExists('628123456789');

// Get Avatar
$avatar = $device->avatar('628123456789');

// Change Avatar
$device->changeAvatar('/path/to/new/avatar.jpg');
```

### Chat Management

[](#chat-management)

Interact with chats and messages.

```
// Get Chat List
$chats = $device->chatList(limit: 10, search: 'John');

// Get Messages from a Chat
$messages = $device->chatMessages('628123456789@s.whatsapp.net', limit: 20);
```

### Logging

[](#logging)

If logging is enabled in the config, all requests and statuses are logged to the `go_whatsapp_logs` table.

### Queueing

[](#queueing)

To improve performance, you can choose to send messages in the background using Laravel Queues.

1. Enable queuing in your `.env` or config:

    ```
    GO_WHATSAPP_QUEUE_ENABLED=true
    ```
2. (Optional) Configure the queue connection and name:

    ```
    GO_WHATSAPP_QUEUE_CONNECTION=redis
    GO_WHATSAPP_QUEUE_NAME=whatsapp_messages
    ```

When enabled, all `send*` methods (e.g., `sendMessage`, `sendImage`) will dispatch a job and return `true` immediately. The actual API call happens in the background worker.

### Direct Connector Usage

[](#direct-connector-usage)

If you need to access the underlying Saloon connector directly, you can resolve it from the container:

```
use Zifala\GoWhatsApp\GoWhatsAppConnector;

$connector = app(GoWhatsAppConnector::class);

// Use generated resources directly
$response = $connector->sending()->sendMessage();
```

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance72

Regular maintenance activity

Popularity17

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity49

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

Every ~0 days

Total

9

Last Release

156d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b5b90036b0a31960f806d3ec6aa5960994120e5478d40eae2c7f137ff445be01?d=identicon)[mohaaosman](/maintainers/mohaaosman)

---

Top Contributors

[![mohaaosman](https://avatars.githubusercontent.com/u/21177710?v=4)](https://github.com/mohaaosman "mohaaosman (13 commits)")

---

Tags

laravellaravel-packagewhastapp-bot

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/zifala-go-whatsapp-laravel/health.svg)

```
[![Health](https://phpackages.com/badges/zifala-go-whatsapp-laravel/health.svg)](https://phpackages.com/packages/zifala-go-whatsapp-laravel)
```

###  Alternatives

[crescat-io/saloon-sdk-generator

Simplified SDK Scaffolding for Saloon

13130.9k7](/packages/crescat-io-saloon-sdk-generator)[codebar-ag/laravel-docuware

DocuWare integration with Laravel

1221.1k](/packages/codebar-ag-laravel-docuware)[codebar-ag/laravel-zammad

Zammad integration with Laravel

106.1k](/packages/codebar-ag-laravel-zammad)[ziming/laravel-myinfo-sg

Laravel Package for Singapore MyInfo

1630.9k](/packages/ziming-laravel-myinfo-sg)

PHPackages © 2026

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