PHPackages                             zarulizham/laravel-openwa - 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. zarulizham/laravel-openwa

ActiveLibrary

zarulizham/laravel-openwa
=========================

Laravel wrapper for the OpenWA WhatsApp gateway API

1.0.2(today)06↑2900%MITPHPPHP ^8.4CI passing

Since Jul 31Pushed todayCompare

[ Source](https://github.com/zarulizham/laravel-openwa)[ Packagist](https://packagist.org/packages/zarulizham/laravel-openwa)[ Docs](https://github.com/zarulizham/laravel-openwa)[ GitHub Sponsors](https://github.com/:vendor_name)[ RSS](/packages/zarulizham-laravel-openwa/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (13)Versions (4)Used By (0)

Laravel OpenWA
==============

[](#laravel-openwa)

[![Latest Version on Packagist](https://camo.githubusercontent.com/372bb358bb7bc3da9570998a5e1d85c6a4a01b665ded3a8a13068aceb6ac3e91/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7a6172756c697a68616d2f6c61726176656c2d6f70656e77612e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/zarulizham/laravel-openwa)[![Total Downloads](https://camo.githubusercontent.com/f330953188dad0ba53e7274cdac517a6e548e51d338b86a7d7a4367df7284206/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7a6172756c697a68616d2f6c61726176656c2d6f70656e77612e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/zarulizham/laravel-openwa)

A Laravel wrapper for the [OpenWA](https://openwa.prooffice.com.my/api/docs) WhatsApp gateway API — list sessions, send text/image/document messages, and a `whatsapp` Notification channel.

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

[](#installation)

You can install the package via composer:

```
composer require zarulizham/laravel-openwa
```

Publish the config file:

```
php artisan vendor:publish --tag="openwa-config"
```

Set your OpenWA server details in `.env`:

```
OPENWA_BASE_URL=https://openwa.prooffice.com.my/api
OPENWA_API_KEY=your-api-key
OPENWA_TIMEOUT=30
OPENWA_SESSION_NAME=my-bot

```

`OPENWA_SESSION_NAME` is optional. When set, `getLatestReadySessionId()` (and any send call that omits an explicit session id) only considers the session with that `name` — instead of the most recently connected `ready` session across all of them. The resolved session id is cached for 3 hours.

Usage
-----

[](#usage)

```
use ZarulIzham\OpenWa\Facades\OpenWa;

// List all sessions
$sessions = OpenWa::getSessions();

// Get the id of the most recently connected session with status "ready"
$sessionId = OpenWa::getLatestReadySessionId();

// Send a text message (auto-resolves the latest ready session if omitted)
OpenWa::sendText('628123456789@c.us', 'Hello from OpenWA!');

// Send an image
OpenWa::sendImage('628123456789@c.us', [
    'url' => 'https://example.com/image.jpg',
    'caption' => 'Check this out!',
]);

// Send a document
OpenWa::sendDocument('628123456789@c.us', [
    'url' => 'https://example.com/invoice.pdf',
    'filename' => 'invoice.pdf',
]);
```

### Notifications

[](#notifications)

Add a `routeNotificationForWhatsapp()` method to your notifiable model:

```
public function routeNotificationForWhatsapp(): string
{
    return $this->phone.'@c.us';
}
```

Implement `ZarulIzham\OpenWa\Notifications\WhatsAppNotification` on your notification and return an `OpenWaMessage` from `toWhatsApp()`:

```
use Illuminate\Notifications\Notification;
use ZarulIzham\OpenWa\Notifications\OpenWaMessage;
use ZarulIzham\OpenWa\Notifications\WhatsAppNotification;

class OrderShipped extends Notification implements WhatsAppNotification
{
    public function via($notifiable): array
    {
        return ['openwa'];
    }

    public function toWhatsApp($notifiable): OpenWaMessage
    {
        return OpenWaMessage::text("Your order #{$this->order->id} has shipped!");
    }
}
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Zarul Izham](https://github.com/zarulizham)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

44

—

FairBetter than 90% of packages

Maintenance100

Actively maintained with recent releases

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity53

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

3

Last Release

0d ago

### Community

Maintainers

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

---

Top Contributors

[![zarulizham](https://avatars.githubusercontent.com/u/10229855?v=4)](https://github.com/zarulizham "zarulizham (7 commits)")

---

Tags

laravelwhatsappzarulizhamopenwa

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/zarulizham-laravel-openwa/health.svg)

```
[![Health](https://phpackages.com/badges/zarulizham-laravel-openwa/health.svg)](https://phpackages.com/packages/zarulizham-laravel-openwa)
```

###  Alternatives

[spatie/laravel-permission

Permission handling for Laravel 12 and up

12.9k107.5M1.5k](/packages/spatie-laravel-permission)[dedoc/scramble

Automatic generation of API documentation for Laravel applications.

2.2k12.6M120](/packages/dedoc-scramble)[spatie/laravel-pdf

Create PDFs in Laravel apps

1.0k5.4M49](/packages/spatie-laravel-pdf)[codewithdennis/filament-select-tree

The multi-level select field enables you to make single selections from a predefined list of options that are organized into multiple levels or depths.

329575.9k33](/packages/codewithdennis-filament-select-tree)[harris21/laravel-fuse

Circuit breaker for Laravel queue jobs. Protect your workers from cascading failures.

24773.9k](/packages/harris21-laravel-fuse)[vormkracht10/laravel-mails

Laravel Mails can collect everything you might want to track about the mails that has been sent by your Laravel app.

25060.1k](/packages/vormkracht10-laravel-mails)

PHPackages © 2026

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