Download the PHP package finller/laravel-conversations without Composer
On this page you can find all versions of the php package finller/laravel-conversations. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download finller/laravel-conversations
More information about finller/laravel-conversations
Files in finller/laravel-conversations
Package laravel-conversations
Short Description Attach chat to any model
License MIT
Homepage https://github.com/ElegantEngineeringTech/laravel-conversations
Informations about the package laravel-conversations
Attach a chat to any model with granular read tracking
This package gives your Laravel app a lightweight, backend-only chat system. It supports multiple users per conversation, per-message read tracking, pivot-level read pointers, and optional model attachment via polymorphic relations.
Features
- Multiple participants per conversation
- Per-message read receipts (
MessageReadmodel) - Fast unread queries via denormalized
last_read_message_idon the pivot - Mute and archive conversations per user
- Attach conversations to any Eloquent model (e.g. a
Mission,Order, orProject) - Widget messages for rich content (e.g. custom Livewire/Vue components)
- Markdown helper with inline-only parsing, autolinks, and safe external links
Requirements
- PHP ^8.1
- Laravel 11, 12, or 13
Installation
Publish and run migrations:
Publish the config (optional):
Setup
1. Let users participate in conversations
Add the ParticipateToConversations trait to your User model:
2. Attach a conversation to another model (optional)
If you want a conversation tied to, say, a Mission or Project, use HasConversation:
Usage
Create a conversation
Send a message
When you call send(), the package will:
- Save the message
- Update the conversation’s
latest_message_idandmessaged_at - Automatically mark the message as read for the sender
Read status
Mark a message as read
Mark a message as unread
Check read status
Mark everything as read via the pivot (fast denormalized pointer)
This updates the conversation_user.last_read_message_id column, which makes unread-conversation queries extremely fast.
Query unread / read conversations
Via Conversation scopes (checks MessageRead rows)
Via the User relationship (denormalized pivot)
Query unread / read messages
Mute and archive conversations
Each participant can mute or archive a conversation via the pivot:
Convenience accessors on the user:
Widget messages
Sometimes a message is not plain text but a UI component. You can store a widget payload:
Helpers on the message:
Markdown helper
Messages can be rendered as safe inline Markdown:
This uses league/commonmark with inline-only, autolinks, and safe external links.
Configuration
Custom models
You can extend any model and override it in the config. For example, if you need extra casts or methods on Message:
Then update config/conversations.php:
Testing
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
Please review our security policy on how to report security vulnerabilities.
Credits
- Quentin Gabriele
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-conversations with dependencies
illuminate/contracts Version ^11.0||^12.0||^13.0
spatie/laravel-package-tools Version ^1.13.6