PHPackages                             baha2odeh/yii2-rocket-chat-rest-client - 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. baha2odeh/yii2-rocket-chat-rest-client

AbandonedLibrary[API Development](/categories/api)

baha2odeh/yii2-rocket-chat-rest-client
======================================

Yii2 Rocket Chat REST API client in PHP.

1.1(7y ago)22401PHP

Since Jun 20Pushed 7y ago1 watchersCompare

[ Source](https://github.com/Baha2Odeh/yii2-rocket-chat-rest-client)[ Packagist](https://packagist.org/packages/baha2odeh/yii2-rocket-chat-rest-client)[ RSS](/packages/baha2odeh-yii2-rocket-chat-rest-client/feed)WikiDiscussions master Synced yesterday

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

Rocket Chat REST API client in PHP
==================================

[](#rocket-chat-rest-api-client-in-php)

Use this client if you need to connect to Rocket Chat with a software written in PHP, such as WordPress or Drupal.

How to use
----------

[](#how-to-use)

This Rocket Chat client is installed via [Composer](http://getcomposer.org/). To install, simply add it to your `composer.json` file:

```
{
    "require": {
        "baha2odeh/yii2-rocket-chat-rest-client": "dev-master"
    }
}
```

And run composer to update your dependencies:

```
$ php composer.phar update

```

After this, you have to register chat instance into components
common/config/main-local.php

```
 'components' => [
 	.....
 	'chat' => [
            'class' => '\Baha2Odeh\RocketChat\Rocket',
            'rocket_chat_instance' => 'http://rocket-chat-server:3000',
            'rest_api_root' => '/api/v1/'
        ],

 ]
```

Finally, instance the classes you need:

```
$user = \Yii::$app->chat->user();

        $info = [
            'name'=>'name',
            'username'=>'username',
            'email'=>'username@email.com',
            'pass'=>'123123123'
        ];

        if(($userInfo = $user->login($info['username'],$info['pass'],true))){
            print_r($userInfo);
        }else if($user->register($info) &&  ($userInfo = $user->login($info['username'],$info['pass'],true))){
            print_r($userInfo);
        }else{
            die($user->error);
        }

        $group = $user->group('group-name',[$userInfo->userId]);

        $group->create();

        $group->postMessage('Hello world');

```

Post a message
--------------

[](#post-a-message)

```
// create a new channel
$channel = $user->channel( 'my_new_channel', array($newuser, $admin) );
$channel->create();
// post a message
$channel->postMessage('Hello world');
```

Credits
-------

[](#credits)

This REST client uses the excellent [Httpful](http://phphttpclient.com/) PHP library by [Nate Good](https://github.com/nategood) ([github repo is here](https://github.com/nategood/httpful)).

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 54.8% 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

2883d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2823958?v=4)[Bahaa Odeh](/maintainers/Baha2Odeh)[@Baha2Odeh](https://github.com/Baha2Odeh)

---

Top Contributors

[![Baha2Odeh](https://avatars.githubusercontent.com/u/2823958?v=4)](https://github.com/Baha2Odeh "Baha2Odeh (17 commits)")[![alekseykuleshov](https://avatars.githubusercontent.com/u/6037974?v=4)](https://github.com/alekseykuleshov "alekseykuleshov (9 commits)")[![Fab1en](https://avatars.githubusercontent.com/u/1143066?v=4)](https://github.com/Fab1en "Fab1en (5 commits)")

### Embed Badge

![Health badge](/badges/baha2odeh-yii2-rocket-chat-rest-client/health.svg)

```
[![Health](https://phpackages.com/badges/baha2odeh-yii2-rocket-chat-rest-client/health.svg)](https://phpackages.com/packages/baha2odeh-yii2-rocket-chat-rest-client)
```

###  Alternatives

[skeeks/yii2-google-api

Component for work with google api based on google/apiclient

1243.1k1](/packages/skeeks-yii2-google-api)[apexwire/yii2-restclient

Tools to use API as ActiveRecord for Yii2

143.5k](/packages/apexwire-yii2-restclient)

PHPackages © 2026

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