condoedge/discussions 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

condoedge/discussions

Composer 安装命令:

composer require condoedge/discussions

包简介

Channels, discussions and chat components for Kompo applications

README 文档

README

Channels, discussions and chat components for Kompo applications.

What it provides

  • Models: Channel, Discussion (self-referencing for replies/subjects), DiscussionRead (read receipts), DiscussionBox (archive/trash per user), Member (channel membership pivot).
  • Komponents: ChannelsView (3-column chat page), ChannelsList / ChannelsListTeam, ChannelSubjectsList, ChannelDiscussionsPanel, DiscussionForm, SingleDiscussionCard, ProjectDiscussionThread, ChannelSettingsForm.
  • Policies: ChannelPolicy / DiscussionPolicy, registered automatically (membership-based).
  • Broadcasting: a DiscussionSent event broadcast on the private channel discussion.{teamId}; the channel authorization callback is registered by the package's service provider.

Installation

composer require condoedge/discussions

The service provider is auto-discovered. Migrations load automatically (php artisan migrate).

Route registration

The package does not auto-register routes. Call the static registrars from your app's route files, inside your auth middleware group:

Route::middleware(['auth'])->group(function () {
    \Kompo\Discussions\Services\DiscussionsService::setAllRoutes();      // discussions pages
    \Kompo\Discussions\Services\DiscussionsService::setAllModalRoutes(); // channel-settings modal
});

Live refresh (Pusher)

The chat lists refresh live through Laravel broadcasting. The host app must have broadcasting enabled:

  1. Enable App\Providers\BroadcastServiceProvider in config/app.php (registers /broadcasting/auth).
  2. Set BROADCAST_DRIVER=pusher and the PUSHER_* / MIX_PUSHER_* env values.
  3. composer require pusher/pusher-php-server.
  4. Make sure the front-end bundle initializes Echo (kompo's withBroadcasting()).

The package takes care of the rest: the discussion.{teamId} channel authorization (team membership) and the event-name wiring between DiscussionSent::broadcastAs() and the komponents' pusherRefresh.

Styling

Import the package stylesheet in your app's scss:

@import "../../vendor/condoedge/discussions/resources/scss/discussions";

The chat page (.discussions-page) sizes itself to the area below your app's navbar; no fixed viewport heights are used.

Host integration points

  • Listen to Kompo\Discussions\Events\DiscussionSent (exposes getDiscussion()) for notifications.
  • Override the team users available in a channel by defining getAvailableUsersForChannel($channel, $search) on your Team model.
  • Translations are flat JSON keys (discussions.*) for the en and fr locales; app-level JSON translations override them.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-03-01

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固