PHPackages                             agielks/yii2-wablas - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. agielks/yii2-wablas

ActiveYii2-extension[Utility &amp; Helpers](/categories/utility)

agielks/yii2-wablas
===================

Wablas wrapper for Yii2

1.1.0(2y ago)22942[1 PRs](https://github.com/agielks/yii2-wablas/pulls)BSD-3-ClausePHPPHP &gt;=7.4.0

Since Jul 25Pushed 1y ago1 watchersCompare

[ Source](https://github.com/agielks/yii2-wablas)[ Packagist](https://packagist.org/packages/agielks/yii2-wablas)[ RSS](/packages/agielks-yii2-wablas/feed)WikiDiscussions master Synced 1mo ago

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

Yii2 Wablas
===========

[](#yii2-wablas)

This extension is wrapper of Wablas API for [Yii framework 2.0](http://www.yiiframework.com) (requires PHP 7.4+).

[![Latest Stable Version](https://camo.githubusercontent.com/b50cb497e81c7019ac6df4475a1cb42c0ac15b5224a3f6091f784904280beaf0/687474703a2f2f706f7365722e707567782e6f72672f616769656c6b732f796969322d7761626c61732f76)](https://packagist.org/packages/agielks/yii2-wablas)[![Total Downloads](https://camo.githubusercontent.com/d3742470506902ebe739fcbfd0d2b5e184d79f8730ec3fc3fa07a569015768e8/687474703a2f2f706f7365722e707567782e6f72672f616769656c6b732f796969322d7761626c61732f646f776e6c6f616473)](https://packagist.org/packages/agielks/yii2-wablas)[![Latest Unstable Version](https://camo.githubusercontent.com/03a1537715d81ffd11693394592140131691162e41ac541a0a1d7fc43a7cf9e1/687474703a2f2f706f7365722e707567782e6f72672f616769656c6b732f796969322d7761626c61732f762f756e737461626c65)](https://packagist.org/packages/agielks/yii2-wablas)[![License](https://camo.githubusercontent.com/524947315c159604eca6d47ce4a8533cfcedc3ffb31bbd0c0b55fb05a7d298ea/687474703a2f2f706f7365722e707567782e6f72672f616769656c6b732f796969322d7761626c61732f6c6963656e7365)](https://packagist.org/packages/agielks/yii2-wablas)[![PHP Version Require](https://camo.githubusercontent.com/90f29f2d5ad7d608c6e24b113c7d1fd251361cea48a3fd074247c037aa2befac/687474703a2f2f706f7365722e707567782e6f72672f616769656c6b732f796969322d7761626c61732f726571756972652f706870)](https://packagist.org/packages/agielks/yii2-wablas)

Table of contents
-----------------

[](#table-of-contents)

1. [Installation](#installation)
2. [Dependencies](#dependencies)
3. [Basic usage](#basic-usage)
    1. [Create request](#basicusage-request)
    2. [Create response](#basicusage-response)
    3. [Create version](#basicusage-version)
4. [Step by step](#step-by-step)

Instalation
-----------

[](#instalation)

Package is available on [Packagist](https://packagist.org/packages/agielks/yii2-wablas), you can install it using [Composer](http://getcomposer.org).

```
composer require agielks/yii2-wablas ~1.0
```

or add to the require section of your `composer.json` file.

```
"agielks/yii2-wablas": "~1.0"

```

Dependencies
------------

[](#dependencies)

- PHP 7.4+
- [yiisoft/yii2](https://github.com/yiisoft/yii2)
- [yiisoft/yii2-httpclient](https://github.com/yiisoft/yii2-httpclient)

Basic Usage
-----------

[](#basic-usage)

Add `wablas` component to your configuration file

```
'components' => [
    'wablas' => [
        'class' => \agielks\yii2\wablas\Wablas::class,
        'endpoint' => 'my-wablas.com/api', // Change with your wablas API endpoint
        'token' => 'my-token', // Change with your wablas API token
    ],
],
```

Create Request
--------------

[](#create-request)

```
$data = [
    [
        'phone' => '6281218xxxxxx',
        'message' => 'hello there',
    ]
];

/* @var $wablas \agielks\yii2\wablas\versions\V2 */

$wablas = $this->wablas->build('v2');
$request = $wablas->sendMessage($data)->request;

// Print request to string
print_r($request->toString());

// Short command
$request = $this->wablas->build('v2')->sendMessage($data)->request;
```

Create Response
---------------

[](#create-response)

```
$data = [
    [
        'phone' => '6281218xxxxxx',
        'message' => 'hello there',
    ]
];

/* @var $wablas \agielks\yii2\wablas\versions\V2 */

$wablas = $this->wablas->build('v2');
$response = $wablas
    ->sendMessage($data)
    ->send()
    ->response;

// Print whether response is OK
print_r($response->isOk);

// Print status code
print_r($response->statusCode);

// Print response data
print_r($response->data);

// Short command
$response = $this->wablas->build('v2')->sendMessage($data)->send()->response;
```

Custom version
--------------

[](#custom-version)

You can create your own version as follows

1. Create custom version

```
class CustomVersion extends BaseObject
{
    public $wablas;

    public function sendMessage(array $data): Wablas
    {
        $this->wablas->setRequest($this->wablas->client->post(['custom/send-message'])->setData($data));
        return $this->wablas;
    }
}
```

2. Register custom version

```
'components' => [
    'wablas' => [
        'class' => \agielks\yii2\wablas\Wablas::class,
        'endpoint' => 'my-wablas.com', // Change with your endpoint
        'token' => 'my-token', // Change with your wablas token,
        'versions' => [
            'custom' => CustomVersion::class,
        ]
    ],
],
```

3. Call the custom version

```
$wablas = $this->wablas->build('custom')->sendMessage($data)->send();
```

Send Message Example
--------------------

[](#send-message-example)

### Step by step usage

[](#step-by-step-usage)

1. Install component

```
composer require agielks/yii2-wablas ~1.0
```

2. Update your components configuration

```
'components' => [
    // other components here...
    'wablas' => [
        'class' => \agielks\yii2\wablas\Wablas::class,
        'endpoint' => 'my-wablas.com/api',
        'token' => 'my-token',
    ],
    // ...
],
```

3. Update controller

```
use Yii;
use yii\web\Controller;

class TestController extends Controller
{
    public function actionTest()
    {
        $data = [
            [
                'phone' => '6281218xxxxxx',
                'message' => 'hello there',
            ]
        ];

        $response = Yii::$app->wablas->build('v2')->sendMessage($data)->send()->response;

        if ($response->isOk) {
            print_r($response); // Do action
        } else {
            print_r($response); // Do action
        }
    }
}
```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance26

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 61.5% 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 ~647 days

Total

2

Last Release

740d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/47511429?v=4)[Agiel K. Saputra](/maintainers/agielks)[@agielks](https://github.com/agielks)

---

Top Contributors

[![wanforge](https://avatars.githubusercontent.com/u/16300077?v=4)](https://github.com/wanforge "wanforge (8 commits)")[![agielks](https://avatars.githubusercontent.com/u/47511429?v=4)](https://github.com/agielks "agielks (5 commits)")

---

Tags

yii2componentyii2-wablaswablas

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/agielks-yii2-wablas/health.svg)

```
[![Health](https://phpackages.com/badges/agielks-yii2-wablas/health.svg)](https://phpackages.com/packages/agielks-yii2-wablas)
```

###  Alternatives

[umanskyi31/opengraph

Created a new component for Yii2. The Open Graph component for your website

119.7k](/packages/umanskyi31-opengraph)[dlds/yii2-mlm

Yii2 Multi Level Marketing component

183.8k](/packages/dlds-yii2-mlm)

PHPackages © 2026

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