> ## 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.

# Badges and pinned comments

> Author, staff, and guest badges. Moderators pin one top-level comment per thread from the API or Filament.

Enabled by default:

```php theme={null}
'badges' => [
    'enabled' => true,
    'pins' => true,
    'author_key' => 'user_id',
    'moderator_ids' => [],
],
```

`GET ui` exposes `features.badges` and `features.pins`. The SDKs and Blade partials (`commentify-pro::partials.badges`, `pin-button`) follow those flags.

## Badges

| Badge                 | How it is decided                                                                                                                |
| --------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
| **Author** (OP)       | Comment `user_id` matches `commentable->commentifyAuthorId()`, or the attribute named in `badges.author_key` (default `user_id`) |
| **Staff** / moderator | Comment author passes `isCommentifyModerator()` or is in `moderator_ids`                                                         |
| **Guest**             | `user_id` is null (`isGuest()`)                                                                                                  |

```php theme={null}
public function commentifyAuthorId(): int
{
    return $this->author_id;
}
```

Guest comments (`user_id` null) never get the author badge even if names match.

JSON: `is_author`, `is_moderator`, `is_guest`.

## Pins

One **parent** comment per thread. Pinning another parent clears `pinned_at` on the previous. Replies cannot be pinned (`cannot_pin_reply`).

```
POST   /commentify/api/v1/comments/{id}/pin
DELETE /commentify/api/v1/comments/{id}/pin
```

Moderators only (`ModeratorGate`). `pins` false → 404.

List endpoints call `pinnedFirst()` so the pinned comment stays on top regardless of sort.

Filament's moderation queue has **Pin** / **Unpin**. The kebab menu in the thread shows pin when you are a moderator (demo personas: Maya / Aisha on [commentify.pro/login](https://commentify.pro/login)).
