alisarwar/chat-system
Composer 安装命令:
composer require alisarwar/chat-system
包简介
Real Time Chat System in Laravel using php pusher
README 文档
README
A chat system package for Laravel that enables users to chat with each other using Pusher PHP server. This Package provide you Echosystem ( Event , Controller , Migrations , Models , Views ) which enable your application to start conversatation between two users.
Preview
Requirements
This package requires the following dependencies:
- User Authentication System ( Breeze , Jetstream , Custom )
- Pusher PHP server
- Pusher API keys and secret keys (obtained from your Pusher account)
Features
- Communication through private channel
- Support Conversation Between two Users
- Dark Theme for Chat System
Installation
-
Make sure you have a Pusher keys if you don't have then get them by login to Pusher Dashboard and then create new APP , and install Pusher PHP Server For authentication preffer to install Laravel Breeze package in your Laravel application.
-
Run the following command to install the Laravel Chat System package:
composer require alisarwar/chat-system:dev-main
-
This package provide you Event , Controller , Migrations , Models , Views these things create an echo-system to implement chat system in you application
-
Add Routes to your web.php
# veiw all available users to start conversation Route::get('/message',[MessageController::class , 'message'])->name('message'); # open chat of specfic user Route::get('/chat/{slug?}',[MessageController::class , 'chat'])->name('chat'); # broadcast message to channel Route::post('/broadcast', [MessageController::class , 'broadcast'])->name('broadcast'); # receive message from channel Route::post('/receive', [MessageController::class , 'receive'])->name('receive'); # authenticate private channel Route::post('/pusher/auth', [MessageController::class , 'auth'])->name('pusher.auth');
-
Update your .env
BROADCAST_DRIVER=pusher PUSHER_APP_ID={YOUR_PUSHER_APP_ID} PUSHER_APP_KEY={YOUR_PUSHER_APP_KEY} PUSHER_APP_SECRET={YOUR_PUSHER_APP_SECRET} PUSHER_HOST= PUSHER_PORT=443 PUSHER_SCHEME=https PUSHER_APP_CLUSTER={YOUR_PUSHER_APP_CLUSTER} -
Migrate and Server Your Application
php artisan migrate php artisan serve -
Register Users and start conversation by going to /message
Contributing
Contributions are welcome! If you encounter any issues or have suggestions for improvements, please open an issue or submit a pull request on the GitHub repository.
alisarwar/chat-system 适用场景与选型建议
alisarwar/chat-system 是一款 基于 CSS 开发的 Composer 扩展包,目前已累计 10 次下载、GitHub Stars 达 0, 最近一次更新时间为 2023 年 07 月 10 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 alisarwar/chat-system 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 alisarwar/chat-system 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 10
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 11
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-07-10
