PHPackages                             bleuren/jetstream-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. bleuren/jetstream-chat

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

bleuren/jetstream-chat
======================

A Laravel Jetstream-integrated chat package supporting team and private conversations

237PHP

Since Mar 17Pushed 1y ago1 watchersCompare

[ Source](https://github.com/bleuren/jetstream-chat)[ Packagist](https://packagist.org/packages/bleuren/jetstream-chat)[ RSS](/packages/bleuren-jetstream-chat/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Jetstream Chat
==============

[](#jetstream-chat)

[English](README.md) | [繁體中文](README.zh-TW.md)

**Jetstream Chat** is a real-time chat package perfectly integrated with Laravel Jetstream, supporting private conversations and team chat rooms. This package utilizes Livewire, Laravel Broadcasting (Laravel Echo), and Tailwind CSS to provide a modern and easily integrated chat solution.

---

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

[](#table-of-contents)

- [Description](#description)
- [Requirements](#requirements)
- [Installation](#installation)
- [Configuration](#configuration)
- [Usage Instructions](#usage-instructions)
    - [Accessing the Chat Page](#accessing-the-chat-page)
    - [Starting New Chats](#starting-new-chats)
    - [Real-time Features](#real-time-features)
- [Features](#features)
- [Customization and Extension](#customization-and-extension)
    - [Overriding Views](#overriding-views)
    - [Adjusting Configuration](#adjusting-configuration)
    - [Customizing Translations](#customizing-translations)
    - [Extending Livewire Components](#extending-livewire-components)
    - [Extending Event Logic](#extending-event-logic)
- [Contribution](#contribution)
- [License](#license)
- [Support](#support)
- [References](#references)

---

Description
-----------

[](#description)

**Jetstream Chat** provides a complete chat solution for applications using Laravel Jetstream. It supports:

- Private one-on-one chats: Users can search for other users and create private conversations.
- Team chat rooms: Designed for Jetstream team management, allowing all team members to easily join the same chat room.
- Real-time message notifications: Relies on Laravel Broadcasting and Echo to implement real-time message delivery and unread notification updates.
- Multi-language support: Built-in English and Traditional Chinese translations, no additional configuration required.

---

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

[](#requirements)

- **PHP**: ^8.2
- **Laravel Framework**: ^12.0
- **Laravel Jetstream**: ^5.3 (Team support recommended to use team chat rooms)
- **Livewire**: ^3.0
- **Blade UI Kit**: blade-heroicons ^2.6
- **Broadcasting Driver**: Such as Pusher or other Laravel supported drivers (to implement real-time functionality)

---

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

[](#installation)

### 1. Install via Composer

[](#1-install-via-composer)

From your Laravel project root directory, run:

```
composer require bleuren/jetstream-chat
```

### 2. Publish Resources

[](#2-publish-resources)

To customize configurations, views, translations, and database migrations, execute the following commands:

- **Publish database migration files**: ```
    php artisan vendor:publish --tag="jetstream-chat-migrations"
    ```
- **Publish configuration file** (optional but recommended): ```
    php artisan vendor:publish --tag="jetstream-chat-config"
    ```
- **Publish views**: ```
    php artisan vendor:publish --tag="jetstream-chat-views"
    ```
- **Publish translation files**: ```
    php artisan vendor:publish --tag="jetstream-chat-lang"
    ```

### 3. Run Database Migrations

[](#3-run-database-migrations)

After publishing the database migration files, execute:

```
php artisan migrate
```

This will create the following tables:

- `conversations`: Stores conversation data (type and team association).
- `conversation_participants`: Records conversation participants, unread message counts, and last read time.
- `messages`: Stores the content and sender information for each message.

### 4. Add the `HasConversations` Trait to the User Model

[](#4-add-the-hasconversations-trait-to-the-user-model)

To enable unread message counting and conversation relationships, add the following code to `app/Models/User.php`:

```
use Bleuren\JetstreamChat\Traits\HasConversations;

class User extends Authenticatable
{
    use HasConversations;
    // Other model settings...
}
```

### 5. Set Up Broadcasting

[](#5-set-up-broadcasting)

To implement real-time messages and notifications, ensure you have correctly configured Laravel's broadcasting functionality. If using the Pusher driver, set in `.env`:

```
BROADCAST_DRIVER=pusher
PUSHER_APP_ID=your-app-id
PUSHER_APP_KEY=your-app-key
PUSHER_APP_SECRET=your-app-secret
PUSHER_APP_CLUSTER=mt1

```

Also, set up Laravel Echo in your frontend JavaScript, for example in `resources/js/bootstrap.js`:

```
import Echo from 'laravel-echo';
import Pusher from 'pusher-js';

window.Pusher = Pusher;

window.Echo = new Echo({
    broadcaster: 'pusher',
    key: import.meta.env.VITE_PUSHER_APP_KEY,
    wsHost: import.meta.env.VITE_PUSHER_HOST ?? `ws-${import.meta.env.VITE_PUSHER_APP_CLUSTER}.pusher.com`,
    wsPort: import.meta.env.VITE_PUSHER_PORT ?? 80,
    wssPort: import.meta.env.VITE_PUSHER_PORT ?? 443,
    forceTLS: (import.meta.env.VITE_PUSHER_SCHEME ?? 'https') === 'https',
    enabledTransports: ['ws', 'wss'],
});
```

For details, please refer to [Laravel Broadcasting Documentation](https://laravel.com/docs/12.x/broadcasting) and [Laravel Echo Documentation](https://laravel.com/docs/12.x/broadcasting#client-side-installation).

---

Configuration
-------------

[](#configuration)

After publishing, you can adjust the following configurations in `config/jetstream-chat.php`:

- **path**: Chat page URL path (default is `chat`).
- **messages\_per\_page**: Number of messages displayed per page in the chat box (default 50).
- **search\_min\_characters**: Minimum number of characters to initiate user search (default 2).
- **user\_model**: Can specify a custom user model, default uses the Laravel authentication model.

You can also override the package's views and translation files as needed.

---

Usage Instructions
------------------

[](#usage-instructions)

### Accessing the Chat Page

[](#accessing-the-chat-page)

- The chat page default route is `/chat` (can be changed in the configuration file).
- After users log in, they can see the chat interface, including a conversation list on the left and a chat window on the right.

### Starting New Chats

[](#starting-new-chats)

- **Private Chat**: Click the "New Private" button, and the system will open a modal allowing you to search and select other users for private conversations. If a conversation with that user already exists, it will switch directly.
- **Team Chat**: Click the "New Team Chat" button, select a team you belong to to create a team chat room. Note: This feature requires Jetstream team support.

### Real-time Features

[](#real-time-features)

- **Message Sending and Receiving**: Using Livewire and Laravel Echo, the chat window can receive new messages in real-time. When a user sends a message, it is broadcast to other users in the conversation and automatically marked as read.
- **Notifications**: The bell icon at the top of the page displays the number of unread messages. Click on the bell to expand the notification window, which provides a "Mark All as Read" function.

---

Features
--------

[](#features)

- **Real-time Chat**: Based on Laravel Echo and Broadcasting to implement real-time sending and receiving of messages.
- **Multi-conversation Support**: Supports private conversations and team chat rooms, automatically managing conversation participants and unread message counts.
- **Automatic Read Marking**: When users view chat content, messages are automatically marked as read, and notifications are updated via broadcasting.
- **User Search**: Built-in modal and user search functionality, convenient for initiating new private chats.
- **Multi-language Support**: Provides English and Traditional Chinese translations by default, can be expanded and customized as needed.

---

Customization and Extension
---------------------------

[](#customization-and-extension)

Jetstream Chat is designed with a focus on high extensibility, you can:

### Overriding Views

[](#overriding-views)

After publishing, views are located in `resources/views/vendor/jetstream-chat`, you can modify the interface according to your project style.

### Adjusting Configuration

[](#adjusting-configuration)

Modify `config/jetstream-chat.php` to adjust chat path, message pagination numbers, search character limits, and other parameters.

### Customizing Translations

[](#customizing-translations)

Modify language files in `lang/vendor/jetstream-chat`, add or modify translation content.

### Extending Livewire Components

[](#extending-livewire-components)

The recommended approach for customizing Livewire components is through inheritance. This method provides a good balance between flexibility and maintainability:

1. **Create a custom component by extending the base component**:

```
// In your application: app/Livewire/CustomChatBox.php
namespace App\Livewire;

use Bleuren\JetstreamChat\Livewire\ChatBox as BaseChatBox;

class CustomChatBox extends BaseChatBox
{
    // Override only the methods you need to customize
    public function render()
    {
        // You can use your own view or modify the original logic
        $data = parent::render()->getData();
        // Additional logic...

        return view('your-custom-view', $data);
    }
}
```

2. **Register your custom component** in your `AppServiceProvider` or a dedicated Livewire service provider:

```
// In app/Providers/AppServiceProvider.php
use Livewire\Livewire;
use App\Livewire\CustomChatBox;

public function boot()
{
    // Override the original component registration
    Livewire::component('chat-box', CustomChatBox::class);
}
```

This inheritance approach offers several advantages:

- Maintains a clean separation from the package core
- Selectively override only what needs customization
- Automatically benefits from base class improvements when the package updates
- Simple implementation, requiring only creation of new classes and registration

### Extending Event Logic

[](#extending-event-logic)

Reference event implementations in the `src/Events` directory (such as `ConversationCreated`, `MessageCreated`, `ConversationRead`), and extend broadcasting or event handling processes as needed.

---

Contribution
------------

[](#contribution)

We welcome any form of contribution and feedback!

- For bug reports or feature suggestions, please submit in [GitHub Issues](https://github.com/bleuren/jetstream-chat/issues).
- If you have improvement suggestions, feel free to submit a Pull Request, please follow standard branch management and submission guidelines.

---

License
-------

[](#license)

Jetstream Chat is licensed under the [MIT License](LICENSE). You are free to use, modify, and distribute this package, please refer to the LICENSE file for details.

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance36

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity15

Early-stage or recently created project

 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.

### Community

Maintainers

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

---

Top Contributors

[![bleuren](https://avatars.githubusercontent.com/u/22718976?v=4)](https://github.com/bleuren "bleuren (28 commits)")

### Embed Badge

![Health badge](/badges/bleuren-jetstream-chat/health.svg)

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

###  Alternatives

[froiden/laravel-installer

Laravel web installer

10883.9k](/packages/froiden-laravel-installer)

PHPackages © 2026

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