belfil / atomic-chat
Atomic-fast, scalable messaging SDK for Laravel
Requires
- php: ^8.2
- illuminate/database: ^11.0|^12.0
- illuminate/support: ^11.0|^12.0
Requires (Dev)
- larastan/larastan: ^3.0
- laravel/pint: ^1.27
- orchestra/testbench: ^9.0|^10.0
- phpstan/phpstan: ^2.0
- phpunit/phpunit: ^11.5
README
Atomic-fast, scalable messaging engine for Laravel.
Built for high-performance applications with native Laravel Reverb support, a modular architecture, and a clean Fluent API.
⚠️ Status: Atomic Chat is currently in Alpha. Expect changes.
✨ Features
-
🧩 Actors System
Attach any Eloquent model (User, Bot, Company) to conversations. -
🔗 Fluent Builder API
Elegant, chainable syntax for creating chats and messages. -
🧱 Modular Architecture
Enable only what you need:- Streams
- Private Chats
- Groups
-
⚡ Performance First
Optimized indexes and efficient "read receipts" via watermarks.
🚀 Installation
Install via Composer:
composer require belfil/atomic-chat
Publish config (optional but recommended):
php artisan vendor:publish --tag="atomic-chat-config"
Run migrations:
php artisan migrate
💬 Quick Start
1. Stream Conversations
Streams are the simplest chat type — ideal for logs, feeds, or public messaging.
use Belfil\AtomicChat\Stream\Models\Stream; // Create a stream $chat = Stream::new()->save();
2. Send Messages
Using the Chat instance:
$chat->message() ->content('Hello Atomic World! ⚛️') ->save();
Or via Message Builder:
use Belfil\AtomicChat\Stream\Models\StreamMessage; StreamMessage::new() ->content('Fluent API is awesome') ->chat($chat) ->save();
3. Retrieve Messages
Standard Eloquent relationships:
$messages = $chat->messages() ->latest() ->get();
🧩 Modules
Atomic Chat is fully modular. Configure modules in:
config/atomic-chat.php
'modules' => [ 'stream' => [ 'enabled' => true, 'provider' => \Belfil\AtomicChat\Stream\ServiceProvider::class, ], ],
🛣️ Roadmap
- Private chats module
- Group conversations
- WebSocket
- Message reactions
- Attachments
🤝 Contributing
PRs, ideas, and feedback are welcome — especially during Alpha.
📄 License
See LICENSE.md