承接 laraditz/realm-chat 相关项目开发

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

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

laraditz/realm-chat

最新稳定版本:1.0.0

Composer 安装命令:

composer require laraditz/realm-chat

包简介

Laravel wrapper for Realm Chat SDK

README 文档

README

Latest Version on Packagist Total Downloads GitHub Actions

Laravel wrapper for Realm Chat SDK. Includes event for receiving messages.

Installation

You can install the package via composer:

composer require laraditz/realm-chat

Before Start

Configure your variables in your .env (recommended) or you can publish the config file and change it there.

REALM_CHAT_API_KEY=<your_api_key>
REALM_CHAT_DEVICE_ID=<your_device_id>

(Optional) You can publish the config file via this command:

php artisan vendor:publish --provider="Laraditz\RealmChat\RealmChatServiceProvider" --tag="config"

Run the migration command to create the necessary database table.

php artisan migrate

Add routeNotificationForRealmChat method to your Notifiable model.

public function routeNotificationForRealmChat($notification)
{
    return $this->mobile_no;
}

Usage

Now you can use the channel in your via() method inside the notification:

use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Notification;
use Laraditz\RealmChat\RealmChatChannel;
use Laraditz\RealmChat\RealmChatMessage;

class TestNotification extends Notification
{
    use Queueable;  
  
    public function via($notifiable)
    {
        return [RealmChatChannel::class];
    }
    
    public function toRealmChat($notifiable)
    {
        return (new RealmChatMessage())
            ->content("Test send message!")
            ->media("https://news.tokunation.com/wp-content/uploads/sites/5/2022/07/Kamen-Rider-Geats-Teaser.jpeg", "Kamen-Rider-Geats-Teaser.jpeg");
    }
}

Event

This package also provide an event to allow your application to listen for Realm Chat message receive. You can create your listener and register it under event below.

Event Description
Laraditz\RealmChat\Events\MessageReceived When a message comes in.

Webhook URL

You may setup the URLs below on Realm Chat dashboard so that Realm Chat will push new messages to it and it will then trigger the MessageReceived event above.

https://your-app-url/realm-chat/webhooks/receive //for message receive

Testing

composer test

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email raditzfarhan@gmail.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

Dependency

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-10-19

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固