PHPackages                             cub/cub - 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. cub/cub

ActiveLibrary[API Development](/categories/api)

cub/cub
=======

A PHP Client for Cub

0.1.8(6y ago)16.1k↓67.9%1MITPHPPHP &gt;=5.3

Since Sep 19Pushed 6y ago31 watchersCompare

[ Source](https://github.com/praetoriandigital/cub-php)[ Packagist](https://packagist.org/packages/cub/cub)[ Docs](https://github.com/praetoriandigital/cub-php)[ RSS](/packages/cub-cub/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (1)Versions (10)Used By (1)

[![Build Status](https://camo.githubusercontent.com/3ce6f91503ced39f5289c16fdbe5378d05da5520fc0c02b97a044163875dc427/68747470733a2f2f7472617669732d63692e6f72672f70726165746f7269616e6469676974616c2f6375622d7068702e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/praetoriandigital/cub-php)

Cub Client for PHP
==================

[](#cub-client-for-php)

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

[](#requirements)

PHP versions 5.3, 5.4, 5.5, 5.6, 7.0, 7.1 compiled with cURL.

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

[](#installation)

### Install with Composer

[](#install-with-composer)

If you're using `Composer `\_ to manage dependencies, you can add Cub Client for PHP with it:

```
{
    "require": {
        "cub/cub": ">=0.1.0"
    }
}
```

or to get the latest version off the master branch:

```
{
    "require": {
        "cub/cub": "dev-master"
    }
}
```

### Install source from GitHub

[](#install-source-from-github)

Install the source code:

```
$ git clone git://github.com/praetoriandigital/cub-php.git
```

And include it using the autoloader:

```
require_once '/your/libraries/path/Cub/Autoloader.php';
Cub_Autoloader::register();
```

Or, if you're using Composer:

```
require_once 'vendor/autoload.php';
```

Usage
-----

[](#usage)

### Sign user in

[](#sign-user-in)

```
Cub_Config::$api_key = '';

$user = Cub_User::login($username = '', $password = '');
// Now you can use user object
$first_name = $user->first_name;
$last_name = $user->last_name;
// And so on
```

### Handle webhook from Cub

[](#handle-webhook-from-cub)

```
Cub_Config::$api_key = '';

$user = Cub_Object::fromJson($HTTP_RAW_POST_DATA);

// In this example we handle user creation/modification:
if ($object instanceof Cub_User) {

    if ($user->deleted) {
        // object was deleted, do something with it
    } else {
        // Reload user with membership and organization info
        $user.reload(array('expand' => 'membership__organization'));

        // Now $user contains the most recent information, including membership and organization info
        $organization_name = $user->membership[0]->organization->name;
        // Do something with it
    }
}
```

Check more examples in tests.

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community22

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 67.9% 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 ~98 days

Recently: every ~188 days

Total

9

Last Release

2423d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/6191031?v=4)[Jonny Pickett](/maintainers/jonnypickett)[@jonnypickett](https://github.com/jonnypickett)

![](https://www.gravatar.com/avatar/52836261e30fcb62d3489ecb533b36f70ce4494a976e748d9d191bb6f229d206?d=identicon)[nebolsinp](/maintainers/nebolsinp)

![](https://www.gravatar.com/avatar/02a60c6ff8501fb948e8893a078d1ba6548f6fa8db0a097a605d7fa405f7ab8d?d=identicon)[valentjedi](/maintainers/valentjedi)

---

Top Contributors

[![valignatev](https://avatars.githubusercontent.com/u/7038954?v=4)](https://github.com/valignatev "valignatev (38 commits)")[![Perlence](https://avatars.githubusercontent.com/u/1044300?v=4)](https://github.com/Perlence "Perlence (10 commits)")[![jonnypickett](https://avatars.githubusercontent.com/u/6191031?v=4)](https://github.com/jonnypickett "jonnypickett (4 commits)")[![zadoev](https://avatars.githubusercontent.com/u/491749?v=4)](https://github.com/zadoev "zadoev (3 commits)")[![nebolsinp](https://avatars.githubusercontent.com/u/3922479?v=4)](https://github.com/nebolsinp "nebolsinp (1 commits)")

---

Tags

apiCUB

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/cub-cub/health.svg)

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

###  Alternatives

[m165437/laravel-blueprint-docs

API Blueprint Renderer for Laravel

22879.8k](/packages/m165437-laravel-blueprint-docs)

PHPackages © 2026

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