PHPackages                             wirelabs/fluxchat - 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. wirelabs/fluxchat

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

wirelabs/fluxchat
=================

A beautiful Laravel Livewire chat component built with Flux UI, supporting real-time messaging with Reverb.

v0.2.2(10mo ago)04MITPHPPHP ^8.3

Since Jul 12Pushed 10mo agoCompare

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

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

FluxChat
========

[](#fluxchat)

A beautiful Laravel Livewire chat component built with Flux UI, supporting both standard polling and real-time messaging with Laravel Reverb.

[![FluxChat Preview](https://github.com/user-attachments/assets/3fc916f-902e-35b-b192-952e35b14568)](https://github.com/user-attachments/assets/3fc916f-902e-35b-b192-952e35b14568)

✨ Features
----------

[](#-features)

- 🎨 **Beautiful UI** - Built with Flux UI components
- ⚡ **Real-time Support** - Optional Laravel Reverb integration
- 🔄 **Fallback Polling** - Works without WebSocket server
- 🌍 **Multi-language** - English and Norwegian included
- 📱 **Responsive Design** - Works on all devices
- 🔧 **Highly Configurable** - Customize everything
- 🚀 **Easy Installation** - One command setup

📋 Requirements
--------------

[](#-requirements)

- PHP 8.3+
- Laravel 12.0+
- Livewire 3.0+
- Flux UI Pro 2.0+

🚀 Installation
--------------

[](#-installation)

Install via Composer:

```
composer require wirelabs/fluxchat
```

Run the installation command:

```
php artisan fluxchat:install
```

Run migrations:

```
php artisan migrate
```

🎯 Basic Usage
-------------

[](#-basic-usage)

Add the component to your Blade view:

```

```

Where `$contacts` is a collection of users/contacts:

```
// In your controller
$contacts = User::where('id', '!=', auth()->id())->get();

return view('chat', compact('contacts'));
```

⚙️ Configuration
----------------

[](#️-configuration)

Publish the config file:

```
php artisan vendor:publish --tag="fluxchat-config"
```

### Basic Configuration

[](#basic-configuration)

```
// config/fluxchat.php

return [
    'realtime' => [
        'enabled' => env('FLUXCHAT_REALTIME_ENABLED', false),
        'auto_refresh_interval' => env('FLUXCHAT_AUTO_REFRESH', 5), // seconds
    ],

    'ui' => [
        'theme' => env('FLUXCHAT_THEME', 'dark'),
        'avatar_size' => env('FLUXCHAT_AVATAR_SIZE', 'sm'),
    ],
];
```

### Environment Variables

[](#environment-variables)

Add to your `.env` file:

```
# Standard mode (polling every 5 seconds)
FLUXCHAT_REALTIME_ENABLED=false
FLUXCHAT_AUTO_REFRESH=5

# Real-time mode (requires Reverb)
FLUXCHAT_REALTIME_ENABLED=true
BROADCAST_CONNECTION=reverb
```

🔥 Real-time Messaging
---------------------

[](#-real-time-messaging)

FluxChat supports two modes:

### 1. Standard Mode (Default)

[](#1-standard-mode-default)

- Polls for new messages every 5 seconds
- No additional server required
- Works everywhere

### 2. Real-time Mode

[](#2-real-time-mode)

- Instant message delivery via WebSockets
- Requires Laravel Reverb
- Better user experience

To enable real-time messaging:

1. Install and configure Laravel Reverb:

```
php artisan install:broadcasting
```

2. Update your `.env`:

```
FLUXCHAT_REALTIME_ENABLED=true
BROADCAST_CONNECTION=reverb
```

3. Start the Reverb server:

```
php artisan reverb:start
```

🎨 Customization
---------------

[](#-customization)

### Custom Contact Model

[](#custom-contact-model)

```

```

### Custom Styling

[](#custom-styling)

Publish the views to customize:

```
php artisan vendor:publish --tag="fluxchat-views"
```

Views will be published to `resources/views/vendor/fluxchat/`.

### Language Customization

[](#language-customization)

Publish language files:

```
php artisan vendor:publish --tag="fluxchat-lang"
```

Add your own translations in `resources/lang/vendor/fluxchat/`.

📚 Advanced Usage
----------------

[](#-advanced-usage)

### Programmatic Control

[](#programmatic-control)

```
// In your Livewire component
use Wirelabs\FluxChat\Models\Conversation;
use Wirelabs\FluxChat\Models\Message;

// Create a conversation
$conversation = Conversation::create([
    'type' => 'private',
    'is_group' => false,
]);

// Add participants
$conversation->addParticipant(auth()->user());
$conversation->addParticipant($contact);

// Send a message
$message = $conversation->messages()->create([
    'sendable_id' => auth()->id(),
    'sendable_type' => User::class,
    'body' => 'Hello!',
    'type' => 'text',
]);
```

### Events

[](#events)

Listen to FluxChat events:

```
// EventServiceProvider
use Wirelabs\FluxChat\Events\MessageSent;

protected $listen = [
    MessageSent::class => [
        SendMessageNotification::class,
    ],
];
```

🧪 Testing
---------

[](#-testing)

```
composer test
```

📖 API Reference
---------------

[](#-api-reference)

### Component Properties

[](#component-properties)

PropertyTypeDefaultDescription`contacts`Collection/Array`[]`Available contacts`contactModel`String`User::class`Contact model class`contactNameField`String`'name'`Contact name field`contactSearchFields`Array`['name']`Searchable fields`maxContacts`Integer`10`Max contacts to show### Models

[](#models)

#### Conversation

[](#conversation)

- `messages()` - Get all messages
- `participants()` - Get all participants
- `addParticipant($user)` - Add participant
- `markAsRead($user)` - Mark as read

#### Message

[](#message)

- `conversation()` - Get conversation
- `sendable()` - Get sender
- `isEdited()` - Check if edited

🛠️ Troubleshooting
------------------

[](#️-troubleshooting)

### Real-time not working

[](#real-time-not-working)

1. Check Reverb is running:

```
php artisan reverb:start --debug
```

2. Verify configuration:

```
php artisan config:show broadcasting.default
```

3. Check browser console for WebSocket connections

### Messages not updating

[](#messages-not-updating)

1. Ensure auto-refresh is enabled:

```
FLUXCHAT_AUTO_REFRESH=5
```

2. Check Livewire is working:

```
@livewireScripts
```

🤝 Contributing
--------------

[](#-contributing)

Contributions are welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for details.

📄 License
---------

[](#-license)

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

🙏 Credits
---------

[](#-credits)

- Built by [Wirelabs](https://insidenext.no)
- Powered by [Laravel](https://laravel.com)
- UI by [Flux UI](https://fluxui.dev)
- Real-time by [Laravel Reverb](https://laravel.com/docs/broadcasting)

---

**Made with ❤️ by Wirelabs**

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance54

Moderate activity, may be stable

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity42

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 ~1 days

Total

2

Last Release

308d ago

PHP version history (2 changes)v0.1.0PHP ^8.1|^8.2|^8.3|^8.4

v0.2.2PHP ^8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/362afbebb94f0b56f0c5c8aec9c578ef696104621bf24733b89ede9ab670bc2a?d=identicon)[gets](/maintainers/gets)

---

Top Contributors

[![kwhorne](https://avatars.githubusercontent.com/u/11035264?v=4)](https://github.com/kwhorne "kwhorne (10 commits)")

---

Tags

laravelreal-timelivewiremessagingchatreverbflux-ui

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/wirelabs-fluxchat/health.svg)

```
[![Health](https://phpackages.com/badges/wirelabs-fluxchat/health.svg)](https://phpackages.com/packages/wirelabs-fluxchat)
```

###  Alternatives

[livewire/volt

An elegantly crafted functional API for Laravel Livewire.

4205.3M84](/packages/livewire-volt)[musonza/chat

Chat Package for Laravel

1.2k253.4k1](/packages/musonza-chat)[ramonrietdijk/livewire-tables

Dynamic tables for models with Laravel Livewire

21147.4k](/packages/ramonrietdijk-livewire-tables)[marcorieser/statamic-livewire

A Laravel Livewire integration for Statamic.

2381.5k10](/packages/marcorieser-statamic-livewire)[lexxyungcarter/chatmessenger

Simple one-to-one/group chat messaging tool for Laravel 5, 6, 7, 8, 9 &amp; 10 with Pusher Integration

10724.1k](/packages/lexxyungcarter-chatmessenger)[tomshaw/electricgrid

A feature-rich Livewire package designed for projects that require dynamic, interactive data tables.

116.6k](/packages/tomshaw-electricgrid)

PHPackages © 2026

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