LaravelPackages.net
Acme Inc.
Toggle sidebar
bellal/laravel-pubnub

Broadcast events with PubNub in your Laravel project

6
0
1.1.0
About bellal/laravel-pubnub

bellal/laravel-pubnub is a Laravel package for broadcast events with pubnub in your laravel project. It currently has 0 GitHub stars and 6 downloads on Packagist (latest version 1.1.0). Install it with composer require bellal/laravel-pubnub. Discover more Laravel packages by bellal or browse all Laravel packages to compare alternatives.

Last updated

PubNub

Broadcast events with PubNub from your application

📝 Introduction

Integrates the PubNub service, which makes it unbelieable easy to send broadcast events from your application.

📦 Installation

To install this package you will need:

  • Laravel 5.1+
  • PHP 5.5.9+

You must then modify your composer.json file and run composer update to include the latest version of the package in your project.

Or you can run the composer require command from your terminal.

🔧 Setup

Setup service provider in config/app.php

Bellal\Services\Pubnub\ServiceProvider::class

Setup alias in config/app.php

'Pubnub' => Bellal\Services\Pubnub\Support\Facades\Pubnub::class

Publish config files

php artisan vendor:publish --provider="Bellal\Services\Pubnub\ServiceProvider"

If you want to overwrite any existing config files use the --force parameter

php artisan vendor:publish --provider="Bellal\Services\Pubnub\ServiceProvider" --force

⚙ Usage

Open the config/broadcasing.php file and the following array to the array of connections:

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

Add your PubNub application credentials to your .env file:

BROADCAST_DRIVER=pubnub

PUBNUB_PUBLISH_KEY=YOUR-PUBLISH-KEY
PUBNUB_SUBSCRIBE_KEY=YOUR-SUBSCRIBE-KEY

That's it! All your events will now be broadcasted through PubNub.

🏆 Credits

📄 License

This package is open-sourced software licensed under the MIT license

Star History Chart