mmedia / le-chat
This is my package le-chat
Fund package maintenance!
Michal
Requires
- php: ^8.4 || ^8.3
- illuminate/contracts: ^10.0||^11.0||^12.0
- spatie/laravel-package-tools: ^1.16
- staudenmeir/eloquent-has-many-deep: ^1.7
Requires (Dev)
- larastan/larastan: ^2.9||^3.0
- laravel/pint: ^1.14
- nunomaduro/collision: ^8.1.1||^7.10.0
- orchestra/testbench: ^10.0.0||^9.0.0||^8.22.0
- pestphp/pest: ^3.0
- pestphp/pest-plugin-arch: ^3.0
- pestphp/pest-plugin-laravel: ^3.0
- phpstan/extension-installer: ^1.3||^2.0
- phpstan/phpstan-deprecation-rules: ^1.1||^2.0
- phpstan/phpstan-phpunit: ^1.3||^2.0
- spatie/laravel-ray: ^1.35
This package is auto-updated.
Last update: 2025-07-21 13:37:43 UTC
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 participantsChatParticipant
: A polymorphic link between your models and a chatroomMessage
: A message sent by a participant in a chatroomIsChatParticipant
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 ยฉ