PHPackages                             auraeq/pubnub-laravel - 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. auraeq/pubnub-laravel

AbandonedLibrary[Utility &amp; Helpers](/categories/utility)

auraeq/pubnub-laravel
=====================

A Laravel 4 wrapper for PubNub's php library

0.1-beta(11y ago)41321MITPHPPHP &gt;=5.3.0

Since May 28Pushed 11y ago3 watchersCompare

[ Source](https://github.com/hipsterjazzbo/pubnub-laravel)[ Packagist](https://packagist.org/packages/auraeq/pubnub-laravel)[ RSS](/packages/auraeq-pubnub-laravel/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (2)Versions (2)Used By (0)

pubnub-laravel
==============

[](#pubnub-laravel)

**NOTE** This is a beta release.

This is a nice, clean, OOP Laravel 4 wrapper for [Pubnub's terrible php library](https://github.com/pubnub/php-composer).

All of the (useful) public methods of the base library have been wrapped and exposed with [proper parameters](https://github.com/pubnub/php-composer/blob/master/lib/Pubnub/Pubnub.php#L83-L86), consistent return values, and actual exceptions instead of [incomprehensible array-errors](https://github.com/pubnub/php-composer/blob/master/lib/Pubnub/Pubnub.php#L122).

Two methods have not been wrapped or exposed: `history()` and `detailedHistory()`, because they return a completely metadata-less array of messages that isn't actually that useful.

Here are some things still to do. Got some time and a good brain? Submit a pull request!

- Write some tests. Not sure how best to do this, we'd need to mock the Pubnub calls somehow.
- You can't work with more than one channel at once; this is a restriction of the base library, but maybe one that could be worked around?
- I'm not an expert in this sort of blocking architecture. There may be a better way to implement the `subscribe()` method, but I'm not sure what it is at this stage.
- Maybe figure out the history and detailedHistory methods.
- The `presence()` method doesn't seem to do anything, at least in my brief testing. I think it's just borken? On that note:
- Maybe stop wrapping the base library and just rewrite the whole damn thing cause seriously what is it up to.

Installing
----------

[](#installing)

To install, add the package to your `composer.json`:

```
"require" : {
    ...
    "aura/pubnub-laravel" : "dev-master"
    ...
}
```

then run `composer update`.

Add the following to your `config/app.php` under `'providers'`:

```
'Aura\PubnubLaravel\PubnubLaravelServiceProvider',
```

And then add the following to your `config/app.php` under `'aliases'`:

```
'Pubnub'  => 'Aura\PubnubLaravel\Facades\PubnubLaravelFacade'
```

You'll also want to publish the config file:

```
php artisan config:publish aura/pubnub-laravel
```

And then configure at least your `'origin'`, `'publish_key'` and `'subscriber_key'`.

Usage
-----

[](#usage)

To set the channel:

```
Pubnub::setChannel('channel');
```

You can also set to channel for each method individually, as outlined below. If you try to use a method without having a channel set, a `PubnubChannelException` will be thrown.

---

To publish a message:

```
Pubnub::publish($message[, $channel]);
```

Returns `true` on success or throws `PubnubPublishFailedException` on failure.

---

**Note** This method is blocking. It will never end until there's an error, you return false from your callback, or php times out (I guess).

To subscribe to a message:

```
Pubnub::subscribe(Closure $callback[, $channel]);
```

Returns `true` on success or throws `PubnubSubscribeFailedException` on failure.

There is also a `presence()` method with the same signature that is supposed to notify you of arrivals/departures in the channel you're subscribed to, but it doesn't seem to work (see note above).

---

To see who's currently subscribed:

```
Pubnub::hereNow([$channel]);
```

Returns an array of UUIDs from Pubnub.

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity44

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

Unknown

Total

1

Last Release

4367d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5f7f507b3da5a01b1cdb32f8185d5e45445135a835e807e170922ceba4b82fd9?d=identicon)[HipsterJazzbo](/maintainers/HipsterJazzbo)

---

Tags

laravelrealtimepubnub

### Embed Badge

![Health badge](/badges/auraeq-pubnub-laravel/health.svg)

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

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)[php-junior/laravel-video-chat

Laravel Video Chat using Socket.IO and WebRTC

82018.1k](/packages/php-junior-laravel-video-chat)[interaction-design-foundation/laravel-geoip

Support for multiple Geographical Location services.

17221.0k3](/packages/interaction-design-foundation-laravel-geoip)[nedwors/navigator

A Laravel package to ease defining navigation menus

433.1k](/packages/nedwors-navigator)[dcblogdev/laravel-junie

Install pre-configured guides for Jetbrains Junie

392.5k](/packages/dcblogdev-laravel-junie)

PHPackages © 2026

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