unoapp-dev/laravel-pubnub
Laravel/Lumen的Pubnub事件广播驱动程序
1.0.1
2019-04-16 09:32 UTC
Requires
- pubnub/pubnub: ^4.1
This package is auto-updated.
Last update: 2024-09-16 21:28:24 UTC
README
整合了Pubnub PHP库到Laravel和Lumen中
安装
composer require unoapp-dev/laravel-pubnub
Laravel 5
在config/app.php
中将ServiceProvider添加到providers数组中
'providers' => [ 'Unoappdev\PubnubDriver\PubnubServiceProvider', ]
Lumen
对于Lumen
,在bootstrap/app.php
中添加以下内容
$app->register(Unoappdev\PubnubDriver\PubnubServiceProvider::class);
配置
然后在.env
文件中,添加以下API密钥
PUBNUB_PUBLISH_KEY={YOUR_PUBNUB_PUBLISH_KEY} PUBNUB_SUBSCRIBE_KEY={YOUR_PUBNUB_SUBSCRIBE_KEY}
接下来在config/broadcasting.php
文件中,在connections
数组下,添加PubNub设置
'pubnub' => [ 'driver' => 'pubnub', 'publish_key' => env('PUBNUB_PUBLISH_KEY'), 'subscribe_key' => env('PUBNUB_SUBSCRIBE_KEY'), ],
你可能想要将默认的广播驱动程序更改为pubnub
。