定制 chatsikm/firebase-broadcast-driver-demo 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

chatsikm/firebase-broadcast-driver-demo

Composer 安装命令:

composer require chatsikm/firebase-broadcast-driver-demo

包简介

a firebase broadcast driver demo for laravel

README 文档

README

FireBase Broadcast Driver
Latest Stable Version Total Downloads

Installation

  • composer require ctf0/firebase-broadcast-driver

  • the package internally use kreait/firebase-php to send data to firebase.

Config

// config/broadcasting

return [
    'connections' => [
        // ...

        'firebase' => [
            'driver'          => 'firebase',
            'type'            => 'firestore', // database or firestore
            'databaseURL'     => env('FB_DB_URL'), // the real time database url
            'creds_file'      => env('FB_CREDENTIALS_FILE'), // service account json file
            'collection_name' => env('FB_COLLECTION_NAME'), // ex.notifications
        ],
    ],
];

Usage

  • add BROADCAST_DRIVER=firebase to .env

  • atm there no support for laravel-echo "any help is appreciated" but no worries, you still get the same payload as other broadcast drivers.

    however you can check the firebase api docs or vuefire if you are using vue, on how to listen for changes and update your app users accordingly.

Notification Data Sample

{
    "notifications" : {
        "-LkgtAVVw0Ztwyjayd9n" : {
            "channel" : "private-App.User.091b0f7e-805b-4aab-8c99-445039157783",
            "data" : {
                "body" : "some body",
                "id" : "d54c44a2-8a42-43a4-bae0-e2b159d1533b",
                "title" : "some title",
                "type" : "App\\Notifications\\AlertUser"
            },
            "event" : "Illuminate\\Notifications\\Events\\BroadcastNotificationCreated",
            "timestamp": 1564183089538
        }
    }
}

Security

If you discover any security-related issues, please email ctf0-dev@protonmail.com.

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 8
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-12-05