承接 cwt137/laravel-pubnub-broadcast-driver 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

cwt137/laravel-pubnub-broadcast-driver

Composer 安装命令:

composer require cwt137/laravel-pubnub-broadcast-driver

包简介

PubNub broadcasting events driver for Laravel

README 文档

README

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:

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.

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

        '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.

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.

统计信息

  • 总下载量: 744
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 5
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 5
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-06-09

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固