alisarwar/chat-system 问题修复 & 功能扩展

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

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

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.

Status GitHub Issues GitHub Pull Requests

Preview

Chat System 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

  1. 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.

  2. Run the following command to install the Laravel Chat System package:

    composer require alisarwar/chat-system:dev-main
  3. This package provide you Event , Controller , Migrations , Models , Views these things create an echo-system to implement chat system in you application

  4. 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');
  5. 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}
  6. Migrate and Server Your Application

        php artisan migrate
        php artisan serve
  7. 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.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-07-10