---
title: "Messages for Laravel — docs | Roundly"
description: "Developer docs for Messages for Laravel: direct messages, group threads, roles, replies, attachments, read receipts, inbox, events and broadcasting."
url: https://roundly-consulting.com/open-source/docs/messages-for-laravel
language: en
---

[All packages](https://roundly-consulting.com/open-source.md)

Open source

# Messages for Laravel

Install

`composer require roundly-consulting/messages-for-laravel`

Requires: PHP ^8.4 · Laravel ^12.0|^13.0

[GitHub](https://github.com/roundly-consulting/messages-for-laravel) [Packagist](https://packagist.org/packages/roundly-consulting/messages-for-laravel) [Donate (opens in a new tab)](https://donate.stripe.com/dRmeVe8FX5PF1Qd9pXcEw00) [Patreon](https://www.patreon.com/cw/roundly)

## Overview

A direct-message and group-chat foundation for Laravel. Give any Eloquent model a one-line messaging API through the Messages facade or a model trait — 1:1 DMs, group threads with roles, replies, private file attachments, read receipts and unread counts — react to plain Laravel events, and optionally broadcast every change in real time. MIT-licensed and built only on Laravel plus Roundly’s own enums, media-library and package-toolkit packages — no third-party runtime dependencies.

### What you get

#### One-line DMs & group chats

conversationWith() find-or-creates the single DM between two models; startConversationWith() opens a group. Participants are polymorphic.

#### Roles & moderation

Owner, admin and member roles on group threads, ownership transfer, rename and archive — with typed exceptions, skipped for DMs.

#### Read receipts & inbox

Per-participant read pointers, unread counts, seen-by lists and a paginated inbox that renders without N+1 queries.

#### Replies & private attachments

Quote snapshots that survive edits and deletes, plus private file attachments served only through short-lived signed URLs.

#### Events & optional realtime

Plain Laravel events fire on every write. Flip one env var to broadcast threads, messages, reads and typing over Reverb, Pusher or Ably.

#### Notifications & API resources

Opt-in new-message notifications through Laravel’s own channels, and drop-in JSON resources for an API or SPA backend.

#### Facade, DI or actions — and a recording fake

Call the Messages facade, inject MessagesManager or run an action. Messages::fake() records every call, whichever way it came in.

### Documentation

#### [Installation](https://roundly-consulting.com/open-source/docs/messages-for-laravel/installation.md)

Install via Composer, publish the publish-only migrations for messages and media-library, then migrate.

#### [Configuration](https://roundly-consulting.com/open-source/docs/messages-for-laravel/configuration.md)

Every config key and its default — models, key types, publicity, attachments, roles, notifications, previews, pruning and broadcasting.

#### [Key types](https://roundly-consulting.com/open-source/docs/messages-for-laravel/key-types.md)

Choose bigint, UUID or ULID keys for the messaging tables and for the sender and participant morph columns — before you migrate.

#### [Preparing your models](https://roundly-consulting.com/open-source/docs/messages-for-laravel/preparing-models.md)

Implement ParticipatesInMessaging and add HasMessaging to any model that sends messages or takes part in threads.

#### [The Messages facade](https://roundly-consulting.com/open-source/docs/messages-for-laravel/messages-facade.md)

The whole API on one facade — thread and message builders, DMs, read state, listings, thread, participant and message handles, and pruning.

#### [DI, actions, DTOs & exceptions](https://roundly-consulting.com/open-source/docs/messages-for-laravel/actions-dtos.md)

Inject MessagesManager or run the actions yourself — the facade-to-action map, the DTOs they take and the typed exceptions they throw.

#### [Direct messages](https://roundly-consulting.com/open-source/docs/messages-for-laravel/direct-messages.md)

Find-or-create the single 1:1 thread between two participants with one call — always private, never duplicated.

#### [Group conversations](https://roundly-consulting.com/open-source/docs/messages-for-laravel/group-conversations.md)

Start named group threads, set public and join flags, and add, remove or let participants leave.

#### [Roles & permissions](https://roundly-consulting.com/open-source/docs/messages-for-laravel/roles-permissions.md)

Owner, admin and member roles on group threads — who may add, remove, rename, archive and moderate, and how enforcement works.

#### [Replies & quoting](https://roundly-consulting.com/open-source/docs/messages-for-laravel/replies.md)

Reply to any message in the same thread; a quote snapshot is stored on the reply so it survives edits and deletes.

#### [Attachments](https://roundly-consulting.com/open-source/docs/messages-for-laravel/attachments.md)

Private file attachments backed by media-library — send with a message, read them back, and serve them via short-lived signed URLs.

#### [Inbox & read receipts](https://roundly-consulting.com/open-source/docs/messages-for-laravel/inbox.md)

A paginated, N+1-free inbox with per-thread unread counts, plus read pointers, seen-by lists and unread checks.

#### [Editing & system messages](https://roundly-consulting.com/open-source/docs/messages-for-laravel/editing-system-messages.md)

Edit and unsend messages with typed guards, and write translatable system messages that render in any locale.

#### [Events](https://roundly-consulting.com/open-source/docs/messages-for-laravel/events.md)

Plain Laravel events fire from every write path — with or without broadcasting — for notifications, search indexing and activity logs.

#### [Broadcasting](https://roundly-consulting.com/open-source/docs/messages-for-laravel/broadcasting.md)

Push threads, participants, messages and typing live over Reverb, Pusher or Ably — off by default, fully configurable channels and names.

#### [Notifications](https://roundly-consulting.com/open-source/docs/messages-for-laravel/notifications.md)

Opt in to bridge every new message to Laravel notifications for the thread’s other participants — your class, your channels.

#### [Models & queries](https://roundly-consulting.com/open-source/docs/messages-for-laravel/models-queries.md)

The Thread, Message and Participant models — query scopes, relations, helpers, paginated listings and swapping in your own subclasses.

#### [API resources](https://roundly-consulting.com/open-source/docs/messages-for-laravel/api-resources.md)

Drop-in JSON resources for threads, messages and participants — safe fields only, read state and reply info included.

#### [Artisan commands](https://roundly-consulting.com/open-source/docs/messages-for-laravel/commands.md)

Prune old messages for retention or privacy with messages:prune, and inspect the configuration with php artisan about.

#### [Testing](https://roundly-consulting.com/open-source/docs/messages-for-laravel/testing.md)

Messages::fake() records every operation for assertions, plus factory states, the InteractsWithMessaging trait and Pest expectations.

#### [Requirements](https://roundly-consulting.com/open-source/docs/messages-for-laravel/requirements.md)

PHP 8.4+, Laravel 12 or 13, and three sibling Roundly packages installed automatically.

## Show your open-source love

This package is free and MIT-licensed. If it saves you time, a one-off donation or a Patreon membership keeps it maintained, tested and documented.

[More ways to support, including crypto](https://roundly-consulting.com/support-us.md)

By donating, you agree to our [donation terms](https://roundly-consulting.com/donation-terms.md).

[Support our open source work (opens in a new tab)](https://donate.stripe.com/dRmeVe8FX5PF1Qd9pXcEw00) [Join us on Patreon (opens in a new tab)](https://www.patreon.com/cw/roundly)

## Want this built into your product?

We integrate our packages into custom Laravel and AI builds. Tell us what you're working on and we'll reply within 48 hours.

[Get a quote in 48 hours](https://roundly-consulting.com/contact.md) [Browse all packages](https://roundly-consulting.com/open-source.md)
