定制 statamic/collaboration 二次开发

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

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

statamic/collaboration

Composer 安装命令:

composer require statamic/collaboration

包简介

Real-time collaboration and multi-user authoring for Statamic Pro.

README 文档

README

Collaboration

Real-time collaboration and multi-user authoring for Statamic Pro.

Features

  • Presence indicators when multiple people have the same entry opened.
  • Fields get locked when someone else focuses them.
  • Updates to field values are reflected to everyone.

Installation

You can install and configure the Collaboration addon using a single command:

php please install:collaboration

The command will install the statamic/collaboration addon, setup Laravel's broadcast scaffolding and prompt you to select which broadcast driver you wish to use.

For more information on the specifics for each broadcast driver, please review the following:

Laravel Reverb

The install:collaboration command will install Laravel Reverb into your application. After installation, run php artisan reverb:start to run Reverb's WebSockets server, then the Collaboration addon should start working in the Control Panel.

When you deploy your application to a server, you will need to run the Reverb WebSockets server as a daemon (php artisan reverb:start). If you're using Laravel Forge, there's a Reverb toggle in your site's "Application" panel.

For further information on Reverb, please review the Laravel documentation.

Pusher

The install:collaboration command will install Pusher's PHP SDK into your application. After installation, you should add your Pusher credentials to your .env file:

PUSHER_APP_ID="your-pusher-app-id"
PUSHER_APP_KEY="your-pusher-key"
PUSHER_APP_SECRET="your-pusher-secret"
PUSHER_HOST=
PUSHER_PORT=443
PUSHER_SCHEME="https"
PUSHER_APP_CLUSTER="mt1"

You should also ensure you have enabled the "Client Events" setting (found under the "App Settings" page in the Pusher Dashboard).

Other

If you're planning on using a different broadcasting driver, there are a few additional steps you'll need to take to get it working:

  1. Install & configure your broadcasting driver (obviously)
  2. Update the BROADCAST_DRIVER in your .env
  3. Create a resources/js/cp.js file and add it to the Control Panel.
  4. In your resources/js/cp.js file, register a callback to override Statamic's Echo config:
Statamic.booting(() => {
    Statamic.$echo.config(() => ({
        broadcaster: "pusher",
        key: Statamic.$config.get('broadcasting.pusher.key'),
        cluster: Statamic.$config.get('broadcasting.pusher.cluster'),
        wsHost: Statamic.$config.get('broadcasting.pusher.host'),
        wsPort: Statamic.$config.get('broadcasting.pusher.port'),
        wssPort: Statamic.$config.get('broadcasting.pusher.port'),
        forceTLS: false,
        encrypted: true,
        disableStats: true,
        enabledTransports: ["ws", "wss"],
    }));
});

Configuration

Sound Effects

By default, the Collaboration addon plays sound effects when other users join & leave entries.

If you wish to disable these, you may publish the configuration file (via php artisan vendor:publish --tag=collaboration) and set sound_effects to false.

// config/collaboration.php

return [
    'sound_effects' => false,
];

Advanced Usage

When the "meta data" of a fieldtype is updated, it will be broadcast to the other users in the channel. If you have a fieldtype that contains a large amount of meta data, and it gets updated (some may just provide initial state and never change), you may consider specifying the fields that should be broadcast. This could help keep message sizes smaller and improve performance.

In your fieldtype's preload method, you can use the special __collaboration key to list the fields.

public function preload()
{
    return [
        'hello' => 'world',
        'foo' => 'bar',
        '__collaboration' => ['foo'],
    ];
}

When the meta data gets updated, only the foo value will be broadcast. The remaining values will get merged in automatically.

statamic/collaboration 适用场景与选型建议

statamic/collaboration 是一款 基于 JavaScript 开发的 Composer 扩展包,目前已累计 95.19k 次下载、GitHub Stars 达 36, 最近一次更新时间为 2020 年 01 月 09 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 statamic/collaboration 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 statamic/collaboration 我们能提供哪些服务?
定制开发 / 二次开发

基于 statamic/collaboration 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 95.19k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 36
  • 点击次数: 34
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 36
  • Watchers: 6
  • Forks: 14
  • 开发语言: JavaScript

其他信息

  • 授权协议: proprietary
  • 更新时间: 2020-01-09