承接 ehsan-nosair/chativel 相关项目开发

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

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

ehsan-nosair/chativel

最新稳定版本:v0.1.0-alpha.5

Composer 安装命令:

composer require ehsan-nosair/chativel

包简介

ChatiVel is a plugin that provides a real-time chat system for your laravel application, its support multi-guards, rtl, reverb-pusher, RESTapi, and much more.

README 文档

README

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

real-time chat system for laravel & filament.

  • support multi gurad
  • support rtl
  • languages (en, ar)
  • using laravel broadcasting so you can use (reverb, pusher)

Important

the package is still in development stage

Installation

You can install the package via composer:

composer require ehsan-nosair/chativel

Run this command to install the package, it will publish config file and migrations

php artisan chativel:install

Following steps just if you want to add the chat page to filament panel

Run this command to copy assets to public folder

php artisan filament:assets

You need to use 'filament custom theme' create custom theme. Then add following line to your theme tailwind.config.js file.

content: [
    ...
    './vendor/ehsan-nosair/chativel/resources/views/**/**/*.blade.php',
    ...
]

this package use laravel broadcasting so you need to install it. use following command

php artisan install:broadcasting

then if you want to use it in a filament panel then you need to enable echo in config/filament like following for reverb

// ...
 
'echo' => [
    'broadcaster' => 'reverb',
    'key' => env('VITE_REVERB_APP_KEY'),
    'cluster' => env('VITE_REVERB_APP_CLUSTER'),
    'wsHost' => env('VITE_REVERB_HOST'),
    'wsPort' => env('VITE_REVERB_PORT'),
    'wssPort' => env('VITE_REVERB_PORT'),
    'authEndpoint' => '/broadcasting/auth',
    'disableStats' => true,
    'encrypted' => true,
    'forceTLS' => false,
],
 
// ...

then start reverb server:

php artisan reverb:start

Usage

First: you need to use Chatable trait in your models

<?php

use EhsanNosair\Chativel\Traits\Chatable;

class User extends Authenticatable
{
    use Chatable;
}

Note

you can customize model searchable columns & display column by overriting searchableColumns() & getDisplayColumnAttribute() methods

Second: you need to add your chatable models to chatables array in config/chativel

    <?php
    // ...
    'chatables' => [
        \App\Models\User::class,
    ],
    // ...

Final step: use plusing in your filament panel provider

<?php

use EhsanNosair\Chativel\ChativelPlugin;

class AdminPanelProvider extends PanelProvider
{
    public function panel(Panel $panel): Panel
    {
        return $panel
            //...
            ->plugins([
                ChativelPlugin::make()
            ]);
    }
}

## Testing

```bash
composer test

Changelog

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

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-01-02