Broadcast events with PubNub in your Laravel project
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
Broadcast events with PubNub from your application
Integrates the PubNub service, which makes it unbelieable easy to send broadcast events from your application.
To install this package you will need:
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 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
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.
This package is open-sourced software licensed under the MIT license