2017 © Pedro Peláez
 

library laravel-pubnub-broadcast-driver

PubNub broadcasting events driver for Laravel

image

cwt137/laravel-pubnub-broadcast-driver

PubNub broadcasting events driver for Laravel

  • Tuesday, June 9, 2015
  • by cwt137
  • Repository
  • 1 Watchers
  • 3 Stars
  • 96 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

PubNub Broadcasting Events Driver for Laravel

Install Via Composer

composer require cwt137/laravel-pubnub-broadcast-driver

Setup Laravel

Add the service provider Cwt137\PubnubDriver\PubnubServiceProvider in your config/app.php file. Then in the .env file, add the following API keys:, (*1)

PUBNUB_PUBLISH_KEY={YOUR_PUBNUB_PUBLISH_KEY}
PUBNUB_SUBSCRIBE_KEY={YOUR_PUBNUB_SUBSCRIBE_KEY}

Where {YOUR_PUBNUB_PUBLISH_KEY} and {YOUR_PUBNUB_SUBSCRIBE_KEY} are your PubNub publish and subscribe keys, respectively., (*2)

Next in your config/broadcasting.php file, under the connections array, add the PubNub settings:, (*3)

        'pubnub' => [
            'driver' => 'pubnub',
            'publish_key' => env('PUBNUB_PUBLISH_KEY'),
            'subscribe_key' => env('PUBNUB_SUBSCRIBE_KEY'),
        ],

You probably want to change the defaut driver to pubnub., (*4)

Using Driver

You can use php artisan make:event {Name} to make a Laravel Event. Inside the event, implement the ShouldBroadcast interface by declaring a broadcastOn method. In that method you should return an array of channels you want to broadcast on., (*5)

The Versions

09/06 2015

dev-master

9999999-dev

PubNub broadcasting events driver for Laravel

  Sources   Download

MIT

The Requires

 

by Christopher Thomas