PHPackages                             phucbui/laravel-chat - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. phucbui/laravel-chat

ActiveLibrary[HTTP &amp; Networking](/categories/http)

phucbui/laravel-chat
====================

A flexible realtime chat package for Laravel with multi-actor support, multiple socket drivers, and capability-based access control.

v1.0.2(3mo ago)00MITPHPPHP ^8.2

Since Mar 25Pushed 3mo agoCompare

[ Source](https://github.com/buiphuc/laravel-chat)[ Packagist](https://packagist.org/packages/phucbui/laravel-chat)[ Docs](https://github.com/phucbui/laravel-chat)[ RSS](/packages/phucbui-laravel-chat/feed)WikiDiscussions main Synced 3w ago

READMEChangelogDependencies (7)Versions (4)Used By (0)

PhucBui Laravel Chat
====================

[](#phucbui-laravel-chat)

[![Latest Version on Packagist](https://camo.githubusercontent.com/e7e8d41ed631b8b241c79cbbd8321e299ca62f190a3fdaa7b02d0a81405e48df/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f706875636275692f6c61726176656c2d636861742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/phucbui/laravel-chat)[![Total Downloads](https://camo.githubusercontent.com/6d88fc6ea6f60068ad9893049f66f5c11dda029752a2d5ca09eada224ed75efe/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f706875636275692f6c61726176656c2d636861742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/phucbui/laravel-chat)[![License](https://camo.githubusercontent.com/db60acd30629aba936ca8b9c4a610ff2c3c27e17337d74e36cc3e55afd6740c0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f706875636275692f6c61726176656c2d636861742e7376673f7374796c653d666c61742d737175617265)](https://github.com/phucbui/laravel-chat/blob/main/LICENSE.md)

A next-generation, flexible real-time chat package tailored for Laravel. Designed with a **Multi-Actor System**, polymorphic participants, capability-based access control, and seamless real-time broadcasting integrations (Reverb, Socket.IO, Pusher).

Whether you need a simple 1v1 chat, a customer-support auto-routing module, or a robust multi-role group chat system, `phucbui/laravel-chat` gives you the ultimate foundation.

Table of Contents
-----------------

[](#table-of-contents)

- [Features](#features)
- [Requirements](#requirements)
- [Installation](#installation)
- [Configuration &amp; Setup](#configuration--setup)
    - [1. Configure Actors](#1-configure-actors)
    - [2. Model Setup](#2-model-setup)
    - [3. Register Resolvers](#3-register-resolvers)
- [Key Concepts](#key-concepts)
- [Detailed API Usage](#detailed-api-usage)
- [Broadcasting](#broadcasting)
- [Testing](#testing)
- [License](#license)

---

Features
--------

[](#features)

- 🎭 **Actor-based Architecture**: Support multiple authentication guards and tables simultaneously (e.g. `admins`, `customers`, `users`).
- 🔗 **Polymorphic Participants**: Rooms can hold mixed actor types. Example: 2 Admins and 1 Customer in the same group.
- 🚦 **Capability-Driven Access Control**: Roles aren't hardcoded. Features (creating groups, blocking users, reading reports) are controlled via dynamic boolean flags in config.
- 📡 **Multi-Driver Realtime**: Out-of-the-box support for Laravel Reverb, Pusher, and standard Socket.IO.
- 🤖 **Auto-Routing**: Intelligently route incoming `client` chats to available `admins` based on flexible scheduling strategies (Least busy, Round-robin, Last contacted).
- 📎 **File Attachments**: Send documents and images seamlessly.
- 🛡️ **Block &amp; Report**: Built-in moderation endpoints for banning users and flagging toxic messages.
- 🔍 **Full-Text Search**: Robust message search logic.

---

Requirements
------------

[](#requirements)

- **PHP**: `^8.2`
- **Laravel**: `^11.0` or `^12.0`
- **Database**: MySQL, PostgreSQL, or SQLite

---

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require phucbui/laravel-chat
```

Publish the package assets, configuration, and migrations:

```
php artisan chat:install
```

Run the database migrations:

```
php artisan migrate
```

Seed the default Chat Roles (`owner`, `admin`, `member`):

```
php artisan chat:seed-roles
```

---

Documentation
-------------

[](#documentation)

Since `laravel-chat` is a highly customizable package with multi-actor routing, capabilities, and dynamic websockets, we provide comprehensive documentation in both **English** and **Vietnamese**:

### 🇬🇧 English Documentation

[](#-english-documentation)

- 📖 **[Installation &amp; Setup Guide](specs/en/installation-guide.md)**: Actor configuration, routing, drivers, and broadcasting.
- ⚙️ **[Configuration Reference](specs/en/config.md)**: Detailed explanation of `config/chat.php` with real-world sample cases (Slack clone, Customer Support system).
- 🔌 **[API Endpoints](specs/en/api-endpoints.md)**: Full REST API documentation with exact JSON payloads.
- 📐 **[Other Specifications](specs/README.md)**: Architecture, Models, Events and Services deep dive.

### 🇻🇳 Tài liệu Tiếng Việt

[](#-tài-liệu-tiếng-việt)

- 📖 **[Hướng dẫn Cài đặt &amp; Thiết lập](specs/vi/installation-guide.md)**: Cấu hình Actor, phân quyền, websockets và cách tích hợp.
- ⚙️ **[Giải thích Cấu hình (Config)](specs/vi/config.md)**: Giải thích cấu hình `config/chat.php` kèm các file config mẫu cho thực tế (Slack clone, hệ thống CSKH đa nền tảng).
- 🔌 **[Tài liệu API Endpoints](specs/vi/api-endpoints.md)**: Chi tiết toàn bộ hệ thống giao tiếp API và cấu trúc JSON trả về.
- 📐 **[Tài liệu Khác](specs/README.md)**: Tương tác Event, Sơ đồ Class, Service,...

---

Credits &amp; Contact
---------------------

[](#credits--contact)

Developed and maintained by **Bui Phuc**.

- **Email**:
- **LinkedIn**:
- **Facebook**:

Feel free to reach out if you have any questions, feature requests, or collaboration proposals!

---

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance82

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

3

Last Release

91d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b1ea78d4d1deae2553ff8d68c595f7beb3bc5f5f920aeb8cf4fc03fea14a90bd?d=identicon)[buiphuc](/maintainers/buiphuc)

---

Top Contributors

[![phucbuipira](https://avatars.githubusercontent.com/u/219609033?v=4)](https://github.com/phucbuipira "phucbuipira (5 commits)")

---

Tags

laravelwebsocketpusherrealtimechatSocket.ioreverb

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/phucbui-laravel-chat/health.svg)

```
[![Health](https://phpackages.com/badges/phucbui-laravel-chat/health.svg)](https://phpackages.com/packages/phucbui-laravel-chat)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.1M337](/packages/psalm-plugin-laravel)[laravel/cashier

Laravel Cashier provides an expressive, fluent interface to Stripe's subscription billing services.

2.5k28.4M136](/packages/laravel-cashier)[spatie/laravel-health

Monitor the health of a Laravel application

87411.3M152](/packages/spatie-laravel-health)[fleetbase/core-api

Core Framework and Resources for Fleetbase API

1232.2k16](/packages/fleetbase-core-api)[api-platform/laravel

API Platform support for Laravel

59156.3k11](/packages/api-platform-laravel)[kyrne/websocket

Integrated Pusher replacement.

121.6k1](/packages/kyrne-websocket)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
