承接 ritechoice23/laravel-chat-engine 相关项目开发

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

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

ritechoice23/laravel-chat-engine

Composer 安装命令:

composer require ritechoice23/laravel-chat-engine

包简介

A UI-agnostic, transport-agnostic, polymorphic chat engine for Laravel with message versioning, reactions, bookmarks, and delivery tracking.

README 文档

README

A UI-agnostic, transport-agnostic, polymorphic chat engine for Laravel.

Latest Version on Packagist Tests PHPStan Total Downloads License

Features

  • Polymorphic Actors - Users, Teams, Bots, or any model can chat
  • Thread Types - Direct, Group, Channel, Broadcast, Custom
  • Rich Messages - Text, Image, Video, Audio, File, Location, Contact, Custom
  • Attachments - Multi-file uploads, view-once media, direct request uploads
  • Security - Thread locks, PIN protection, E2E verification codes
  • Reactions - Emoji reactions via laravel-reactions integration
  • Bookmarks - Save/bookmark messages via laravel-saveable integration
  • Delivery Tracking - Delivered and read receipts
  • Edit History - Immutable message versions (configurable)
  • Soft/Hard Delete - Configurable deletion modes
  • Authorization - Built-in policies for threads and messages
  • Pipelines - Message processing (sanitize, mentions, URLs, profanity)
  • Events - Domain events for all actions
  • API Resources - Ready-to-use JSON transformations

Requirements

  • PHP 8.2+
  • Laravel 11.x or 12.x

Installation

composer require ritechoice23/laravel-chat-engine

Publish the config file:

php artisan vendor:publish --tag="chat-engine-config"

Run migrations:

php artisan migrate

Quick Start

Add the trait to your User model:

use Ritechoice23\ChatEngine\Traits\CanChat;

class User extends Authenticatable
{
    use CanChat;
}

Start chatting:

use Ritechoice23\ChatEngine\Facades\Chat;

// Create a thread
$thread = Chat::thread()->between($userA, $userB)->create();

// Send a message
$message = Chat::message()
    ->from($userA)
    ->to($thread)
    ->text('Hello!')
    ->send();

// React to message
$userB->react($message, '❤️');

// Bookmark message
$userB->saveItem($message);

// Mark as read
$message->markAsReadBy($userB);

File Uploads

Upload files directly from Laravel requests:

// Single file
Chat::message()
    ->from($request->user())
    ->to($thread)
    ->text('Check this out!')
    ->attachUpload($request->file('photo'))
    ->send();

// Multiple files
Chat::message()
    ->from($request->user())
    ->to($thread)
    ->attachUploads($request->file('attachments'))
    ->send();

// View-once (self-destructing)
Chat::message()
    ->from($request->user())
    ->to($thread)
    ->attachUploadViewOnce($request->file('secret'))
    ->send();

Message Types

// Text
Chat::message()->from($user)->to($thread)->text('Hello')->send();

// Image
Chat::message()->from($user)->to($thread)
    ->image('https://...', 'Caption')->send();

// Video
Chat::message()->from($user)->to($thread)
    ->video('https://...', 'thumb.jpg', 120)->send();

// File
Chat::message()->from($user)->to($thread)
    ->file('https://...', 'doc.pdf', 'application/pdf')->send();

// Location
Chat::message()->from($user)->to($thread)
    ->location(40.7128, -74.0060, 'NYC')->send();

// Contact
Chat::message()->from($user)->to($thread)
    ->contact('John Doe', '+1234567890', 'john@example.com')->send();

Thread Types

// Direct (1-on-1, automatically deduplicated)
Chat::thread()->between($userA, $userB)->create();

// Group
Chat::thread()->group('Team Chat')->participants([$u1, $u2, $u3])->create();

// Channel
Chat::thread()->channel('announcements')->create();

// Broadcast
Chat::thread()->broadcast('System Updates')->create();

Documentation

See /docs for complete documentation:

Getting Started Core Features System Advanced
Installation Threads Events Encryption
Configuration Messages Policies Retention
Attachments Pipelines Scaling
Security Presence Customization
Delivery API Resources
Reactions
Bookmarks

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

If you discover a security vulnerability, please send an email to daramolatunde23@gmail.com. All security vulnerabilities will be promptly addressed.

Credits

License

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

ritechoice23/laravel-chat-engine 适用场景与选型建议

ritechoice23/laravel-chat-engine 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1 次下载、GitHub Stars 达 1, 最近一次更新时间为 2026 年 01 月 06 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「real-time」 「messaging」 「chat」 「laravel」 「eloquent」 「polymorphic」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

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

围绕 ritechoice23/laravel-chat-engine 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-06