PHPackages                             elbrahms/wa-gateway - 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. [API Development](/categories/api)
4. /
5. elbrahms/wa-gateway

ActiveLibrary[API Development](/categories/api)

elbrahms/wa-gateway
===================

Laravel package for WhatsApp messaging via the Whatsms gateway API

v1.0.1(1mo ago)01MITPHPPHP ^8.1

Since Apr 30Pushed 1mo agoCompare

[ Source](https://github.com/Elbrahms05/wa-gateway)[ Packagist](https://packagist.org/packages/elbrahms/wa-gateway)[ RSS](/packages/elbrahms-wa-gateway/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (6)Versions (3)Used By (0)

elbrahms/wa-gateway
===================

[](#elbrahmswa-gateway)

[![Latest Version on Packagist](https://camo.githubusercontent.com/9e2a014a3bb40aee56f4d43a88d3e9474d3f7e0ba48705e1e4db246c46d2b9a3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f656c627261686d732f77612d676174657761792e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/elbrahms/wa-gateway)[![PHP Version Require](https://camo.githubusercontent.com/eb7fca4c1bfe5904ba516ebc8d42360ea062e5c966e08862c7a669b05108cc05/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f656c627261686d732f77612d676174657761792e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/elbrahms/wa-gateway)[![License](https://camo.githubusercontent.com/150e769d064919c24e065bb94464670f7b5e1e491d8aacef882cee20d286a91e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f656c627261686d732f77612d676174657761792e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)

Laravel package for sending WhatsApp messages through the **Whatsms** gateway API.
Supports text, media, polls, stickers, buttons, lists, locations, vCards, and device/user management.

---

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

[](#requirements)

- PHP ≥ 8.1
- Laravel 11 or 12
- A running [Whatsms](https://whatsms.fite-ne.com) gateway instance

---

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

[](#installation)

```
composer require elbrahms/wa-gateway
```

The service provider and facade are registered automatically via Laravel's package discovery.

Publish the config file:

```
php artisan vendor:publish --tag=wa-gateway-config
```

---

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

[](#configuration)

Add these variables to your `.env`:

```
WA_GATEWAY_URL=https://whatsms.fite-ne.com
WA_GATEWAY_API_KEY=your_api_key_here
WA_GATEWAY_SENDER=22799749554
WA_GATEWAY_TIMEOUT=30
WA_GATEWAY_VERIFY_SSL=true
```

---

Usage
-----

[](#usage)

### Via the Facade

[](#via-the-facade)

```
use Elbrahms\WaGateway\Facades\WaGateway;

// Send a text message
WaGateway::sendMessage('22799123456', 'Hello from Laravel!');

// Send an image
WaGateway::sendMedia('22799123456', 'image', 'https://example.com/photo.jpg', 'Check this out!');

// Send a document
WaGateway::sendMedia('22799123456', 'document', 'https://example.com/report.pdf');

// Send a poll
WaGateway::sendPoll('22799123456', 'Favourite color?', ['Red', 'Blue', 'Green']);

// Send a sticker
WaGateway::sendSticker('22799123456', 'https://example.com/sticker.webp');

// Send a location
WaGateway::sendLocation('22799123456', '13.5137', '2.1098');

// Send a vCard
WaGateway::sendVcard('22799123456', 'Ibrahim Sidi', '22799000000');

// Check if a number is on WhatsApp
$result = WaGateway::checkNumber('22799123456');
// $result['msg']['exists'] === true
```

### Button Message

[](#button-message)

```
WaGateway::sendButton(
    number: '22799123456',
    message: 'How can we help?',
    buttons: [
        ['type' => 'reply',  'displayText' => 'Support'],
        ['type' => 'url',    'displayText' => 'Website', 'url' => 'https://fite-ne.com'],
        ['type' => 'call',   'displayText' => 'Call us', 'phoneNumber' => '22799749554'],
        ['type' => 'copy',   'displayText' => 'Copy code', 'copyCode' => 'PROMO2025'],
    ],
    footer: 'Powered by WaGateway'
);
```

### List Message

[](#list-message)

```
WaGateway::sendList(
    number: '22799123456',
    message: 'Choose a department',
    title: 'Our Departments',
    buttonText: 'View list',
    list: ['Sales', 'Support', 'Billing', 'Technical'],
    footer: 'We reply within 24 h'
);
```

### Device Management

[](#device-management)

```
// Generate QR code to connect a device
$qr = WaGateway::generateQr('22799749554');
// $qr['qrcode'] is a base64-encoded PNG — display or save it

// Create a new device
WaGateway::createDevice('22799000001', 'https://yourapp.com/webhook');

// Get device information
$info = WaGateway::deviceInfo('22799749554');

// Disconnect a device
WaGateway::disconnectDevice('22799749554');
```

### User Management (admin only)

[](#user-management-admin-only)

```
// Create a user
WaGateway::createUser(
    username: 'newuser',
    password: 'secret123',
    email: 'newuser@example.com',
    expire: 30,
    limitDevice: 5
);

// Get user info
$user = WaGateway::userInfo('newuser');
```

### Dependency Injection

[](#dependency-injection)

```
use Elbrahms\WaGateway\WaGateway;

class NotificationService
{
    public function __construct(protected WaGateway $wa) {}

    public function notify(string $phone, string $text): void
    {
        $this->wa->sendMessage($phone, $text);
    }
}
```

### Override Sender Per Call

[](#override-sender-per-call)

Every method accepts an optional `$sender` parameter:

```
WaGateway::sendMessage('22799123456', 'Hello!', sender: '22788868500');
```

---

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

[](#error-handling)

All methods throw `Elbrahms\WaGateway\Exceptions\WaGatewayException` on failure:

```
use Elbrahms\WaGateway\Exceptions\WaGatewayException;

try {
    WaGateway::sendMessage('22799123456', 'Hello!');
} catch (WaGatewayException $e) {
    logger()->error('WaGateway error: ' . $e->getMessage(), $e->getErrors());
}
```

---

Webhook Payload
---------------

[](#webhook-payload)

When your device receives a message the gateway will `POST` to your webhook URL:

```
{
  "device": "22799749554",
  "message": "Hello!",
  "from": "22799123456",
  "name": "Contact Name",
  "participant": null,
  "ppUrl": "https://...",
  "media": null
}
```

---

License
-------

[](#license)

The MIT License (MIT). See [LICENSE.md](LICENSE.md).

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance92

Actively maintained with recent releases

Popularity2

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

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

2

Last Release

40d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2d134c0629df5291e25d0107322927708e215a477a9253eba3ad2508f6dd3356?d=identicon)[elbrahms](/maintainers/elbrahms)

---

Tags

laravelsmsmessaginggatewaywhatsappwhatsms

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/elbrahms-wa-gateway/health.svg)

```
[![Health](https://phpackages.com/badges/elbrahms-wa-gateway/health.svg)](https://phpackages.com/packages/elbrahms-wa-gateway)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3325.1M337](/packages/psalm-plugin-laravel)[defstudio/telegraph

A laravel facade to interact with Telegram Bots

815320.5k3](/packages/defstudio-telegraph)[simplestats-io/laravel-client

Analytics for Laravel. Track visitors, registrations, and payments. Discover which channels actually drive revenue, not just traffic. Server-side, GDPR compliant, ad-blocker proof.

5019.3k](/packages/simplestats-io-laravel-client)[jasara/php-amzn-selling-partner-api

A fluent interface for Amazon's Selling Partner API in PHP

1348.1k1](/packages/jasara-php-amzn-selling-partner-api)

PHPackages © 2026

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