> ## Documentation Index
> Fetch the complete documentation index at: https://docs.commentify.pro/llms.txt
> Use this file to discover all available pages before exploring further.

# Threads

> Sorting, reports, approval, markdown, emoji, read-only mode, lazy loading, and the recursive thread loader.

These flags live in `config/commentify.php`, or under `core` when Pro is installed. See [Configuration](https://docs.commentify.pro/configuration.md).

## Sorting

The dropdown offers newest, oldest, most liked, and most replied. Newest is the default.

```php theme={null}
'default_sort' => 'newest', // newest | oldest | most_liked | most_replied
'enable_sorting' => true,
```

`enable_sorting` set to `false` hides the dropdown and always uses newest. When a `pinned_at` column exists, pinned comments stay first.

## Reporting

```php theme={null}
'enable_reporting' => true,
'report_reasons' => ['spam', 'inappropriate', 'offensive', 'other'],
```

Choosing **other** asks for a note. Each user can report a comment once. Rows land in `comment_reports`. Review them in [Filament](https://docs.commentify.pro/filament.md).

## Approval

```php theme={null}
'require_approval' => false,
```

Turned on, new comments save with `is_approved = false` and stay off the public thread until you approve them. Turned off, comments are approved on save. Toggle this from the Filament **Commentify Settings** page, or approve and disapprove from the Comments resource. Pending rows stay visible to their author.

## Markdown composer

Comments are stored as Markdown and rendered with CommonMark. HTML in the source is stripped. Strikethrough and autolinks are enabled.

```php theme={null}
'enable_markdown_toolbar' => true,
'enable_markdown_preview' => true,
```

The toolbar inserts headings, bold, italic, strikethrough, quotes, code, links, lists, task lists, `@` mentions, and horizontal rules. Preview uses the same renderer as the published comment. The emoji picker inserts the character at the cursor.

```php theme={null}
'enable_emoji_picker' => true,
```

The picker follows the light, dark, or auto theme on both Tailwind and Bootstrap.

## Read-only

```php theme={null}
'read_only' => true,
```

The composer stops accepting posts. With Pro installed, API writes fail with `423` / `read_only`.

## Lazy loading

```php theme={null}
'lazy' => false,
```

The default keeps the thread in the first HTML response. Set `lazy` to `true` and the component renders a placeholder until it enters the viewport. A tag can override the config either way:

```blade theme={null}
<livewire:comments :model="$article" lazy />
<livewire:comments :model="$article" :lazy="false" />
```

Filament **Commentify Settings** includes the same toggle.

## Thread loader

```php theme={null}
'tree_loader' => 'eager', // eager | cte
'max_depth' => 2,
```

`eager` loads `max_depth` levels of replies with nested eager loads. That is the default, and it matches the previous shape (two levels).

`cte` loads the same tree in one recursive query. It runs on MySQL 8+, MariaDB 10.2+, PostgreSQL, SQLite, and SQL Server. Any other value throws. Both loaders go through the `Comment` model, so a global scope on the host app, including a tenancy scope, applies to the page query and to both halves of the recursive query.

`max_depth` is clamped from 0 to 50. `0` does not preload replies. `pagination_count` is how many top-level comments appear per page (default 10).

## Mentions

Type `@` in a reply or edit to search users. Profile links use `users_route_prefix`, `users_route_key`, and `user_profile_route`. See [Configuration](https://docs.commentify.pro/configuration.md).

## Named threads

Pro only. The free package stores every comment on `default`. Pro adds a `thread` column so one record can hold more than one conversation.

```blade theme={null}
<livewire:comments :model="$article" thread="internal" />
```

List and create accept `thread_name` (max 64). Omit it and the API uses `default`. Each comment in the JSON includes `thread_name`.

A thread listed under `threads` with `private` set to `true` is visible to moderators and to the commentable owner. Everyone else gets a 403 on the Livewire thread and on list and create. `allow_guests` on that thread is read by Livewire. The JSON API still follows the global `allow_guests` and `api.guest_comments` flags.

```php theme={null}
'threads' => [
    'default' => ['private' => false],
    'internal' => ['private' => true, 'allow_guests' => false],
],
```

Lock one record without turning on global read-only:

```php theme={null}
use Usamamuneerchaudhary\CommentifyPro\Support\ThreadSettings;

ThreadSettings::put($article, 'default', ['read_only' => true]);
```

That row lives in `commentify_thread_settings` and wins over the config value for that record and thread name. Livewire then hides the composer. The global API read-only check still follows `core.read_only`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.