PHPackages                             unseen-codes/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. unseen-codes/chat

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

unseen-codes/chat
=================

A plug-and-play Livewire chat system for Laravel

v1.0.4(today)02↑2900%MITPHPPHP ^8.2

Since Jun 11Pushed todayCompare

[ Source](https://github.com/Unseen-Codes/unseen-codes-chat)[ Packagist](https://packagist.org/packages/unseen-codes/chat)[ RSS](/packages/unseen-codes-chat/feed)WikiDiscussions main Synced today

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

unseen-codes/chat
=================

[](#unseen-codeschat)

A plug-and-play Livewire single-file chat component for Laravel.

[![Laravel](https://camo.githubusercontent.com/88ce7f9ac798288a91de4918224da3cf354ffc092c40118a331bb5fa3c59f968/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d3131253230253743253230313225323025374325323031332d726564)](https://laravel.com)[![Livewire](https://camo.githubusercontent.com/f58bd4d0482143978a31aec16cbe33ed229fa3ccace5952f0e637a133a1bf915/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c697665776972652d33253230253743253230342d626c7565)](https://livewire.laravel.com)[![PHP](https://camo.githubusercontent.com/3f55c87364aa35ec65a7ab89134395aeaa6e28f40f60be1006eaff8c088b40e9/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e322b2d707572706c65)](https://php.net)

---

What you get
------------

[](#what-you-get)

- Single-file Livewire component — drop `` anywhere
- 1-on-1 and group conversations
- Emoji reactions (toggle on/off)
- Reply threading
- File attachments
- Read receipts (✓✓)
- Typing indicator
- Inline message editing
- Soft-deleted messages
- Config-driven — toggle every feature, swap every model
- No controller needed — all wire: directives

---

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

[](#requirements)

PackageVersionPHP8.2+Laravel11, 12, or 13Livewire3 or 4---

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

[](#installation)

### 1. Install the package

[](#1-install-the-package)

```
composer require unseen-codes/chat
```

### 2. Publish config

[](#2-publish-config)

```
php artisan vendor:publish --tag=chat-config
```

### 3. Publish and run migrations

[](#3-publish-and-run-migrations)

```
php artisan vendor:publish --tag=chat-migrations
php artisan migrate
```

### 4. Add Chattable trait to your User model

[](#4-add-chattable-trait-to-your-user-model)

```
// app/Models/User.php
use UnseenCodes\Chat\Traits\Chattable;

class User extends Authenticatable
{
    use Chattable;
}
```

---

Usage
-----

[](#usage)

### Start a conversation (in any route/page)

[](#start-a-conversation-in-any-routepage)

```
// routes/web.php — no controller needed with Livewire/Volt pages
Route::get('/chat/{user}', function (User $user) {
    $conversation = auth()->user()->chatWith($user);
    return view('chat', compact('conversation'));
})->middleware('auth');
```

### Or using the service directly

[](#or-using-the-service-directly)

```
use UnseenCodes\Chat\Contracts\ChatManagerContract;

$chat = app(ChatManagerContract::class);

// 1-on-1
$conversation = $chat->findOrCreatePrivateConversation($alice, $bob);

// Group
$conversation = $chat->createGroupConversation('Team Chat', $alice, [$bob, $charlie]);
```

### Drop the component in any Blade view

[](#drop-the-component-in-any-blade-view)

```
{{-- resources/views/chat.blade.php --}}

```

That's it. No controller. No extra routes. The component handles everything.

---

Using Volt single-file pages
----------------------------

[](#using-volt-single-file-pages)

If you want the whole chat page as a Volt single file:

```
php artisan make:volt chat/show --class
```

```
{{-- resources/views/livewire/chat/show.blade.php --}}
