定制 mmedia/le-chat 二次开发

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

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

mmedia/le-chat

最新稳定版本:0.3.6

Composer 安装命令:

composer require mmedia/le-chat

包简介

Add chat functionality to your Laravel application.

README 文档

README

Le Chat adds rich, flexible chat functionality to your Laravel application with minimal setup and maximum customization. Whether you're building one-on-one messaging, group chatrooms, or bot integrations, this package gives you the tools to implement powerful conversations between any models in your app.

🚀 Features

  • Send messages between any models
  • One-to-one and multi-user chatrooms
  • System messages and bot support
  • Unread message tracking
  • WebSocket connection detection
  • Notifications via Laravel and WebPush
  • REST API endpoints included
  • No frontend views — bring your own UI

📦 Installation

composer require mmedia/le-chat

Publish migrations and config:

php artisan vendor:publish --tag="chat-migrations"
php artisan migrate

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

🧠 Core Concepts

  • Chatroom: A conversation space containing messages and participants
  • ChatParticipant: A polymorphic link between your models and a chatroom
  • Message: A message sent by a participant in a chatroom
  • IsChatParticipant Trait: Add to any model to enable chat behavior

✅ Requirements

  • PHP 8.0+
  • Laravel 11+

✨ Quick Example

$message = $user->sendMessageTo($otherUser, "Hello!");
$reply = $otherUser->sendMessageTo($user, "Hi back!");

Easily send messages to:

  • Individual users
  • Multiple recipients
  • Entire chatrooms
  • Non-model participants (bots, services, etc.)

🔥 Why Not Chatify?

Unlike Chatify, Le Chat does not limit messages to one sender and one recipient. This package supports:

  • Multi-participant chatrooms
  • Flexible polymorphic model support
  • Bots and non-DB participants

📚 Full Documentation

See the complete usage guide for in-depth examples, APIs, and advanced features:

👉 View Full Docs →

🧪 Comparison to Other Projects

  • Wirechat — Livewire-heavy
  • Musonza Chat — Feature-rich but complex
  • Le Chat — Simple API, full flexibility, no view layer

🙋‍♂️ Use Cases

  • Teacher ↔ Student chat (one-on-one)
  • Teachers + Students group chats per class
  • Chatbot ↔ User conversations
  • Cross-platform relay (e.g. Slack integration)

📖 License

MIT ©

统计信息

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

GitHub 信息

  • Stars: 47
  • Watchers: 3
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-07-20

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固