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

# Commentify Pro

> Self-hosted comments for Laravel with a native Filament admin. Install, both plugins, spam pipeline, and the JSON API in one page.

<img src="https://docs.commentify.pro/images/readme-banner.png" alt="Commentify Pro" class="filament-hidden" />

# Commentify Pro

Self-hosted comments for Laravel, with a native Filament admin. Comments for a blog, reviews for a product, notes on a recipe — same package.

The MIT [Commentify](https://github.com/usamamuneerchaudhary/commentify) package is the Livewire thread. **Commentify Pro** layers on it (it never forks it): a versioned JSON API, React and Vue SDKs that match the Livewire UI, a spam pipeline, and Filament Pro tools (moderation queue, spam log, audit trail, charts).

* Live demo: [commentify.pro](https://commentify.pro)
* Full docs: [docs.commentify.pro](https://docs.commentify.pro)
* Checkout: [Anystack](https://checkout.anystack.sh/commentify-pro)
* Free core: [GitHub](https://github.com/usamamuneerchaudhary/commentify)

## Requirements

* PHP 8.2+
* Laravel 12 or 13
* Filament v4 or v5 (optional, required for the admin plugins)
* Livewire 4 if you use the Blade UI
* Tailwind CSS v4 or Bootstrap 5 for the published views

## Filament at a glance

Register **both** plugins. Pro is additive — it does not replace the free resources.

| Plugin                         | What you get                                                                                           |
| ------------------------------ | ------------------------------------------------------------------------------------------------------ |
| `CommentifyPlugin` (core, MIT) | **Comments** resource, **Comment reports** resource, **Commentify Settings** page                      |
| `CommentifyProPlugin` (Pro)    | **Moderation queue**, **Spam log**, **Moderation audit**, pending-count widget, comments-per-day chart |

Navigation group: **Commentify**.

## Installation

### 1. Core (always)

```bash theme={null}
composer require usamamuneerchaudhary/commentify
php artisan migrate
```

### 2. Pro (after [purchase](https://checkout.anystack.sh/commentify-pro))

```bash theme={null}
composer config repositories.commentify-pro composer https://commentify.composer.sh
composer require usamamuneerchaudhary/commentify-pro
php artisan commentify-pro:install
```

The installer publishes `config/commentify-pro.php`, asks which frontends you use (Livewire / React / Vue), which API guard, which spam checkers, and which models may receive comments. It is safe to re-run. Scripted:

```bash theme={null}
php artisan commentify-pro:install \
    --frontend=livewire --guard=web --spam=heuristic --migrate --no-interaction
```

License checks happen at Composer install only. There is no runtime phone-home.

If you already published `config/commentify.php` from the free package, merge those values into `commentify-pro.core` and delete the extra file. Until you do, Pro will not overlay core settings.

### 3. Register the Filament plugins

In your panel provider (for example `app/Providers/Filament/AdminPanelProvider.php`):

```php theme={null}
use Usamamuneerchaudhary\Commentify\Filament\CommentifyPlugin;
use Usamamuneerchaudhary\CommentifyPro\Filament\CommentifyProPlugin;

public function panel(Panel $panel): Panel
{
    return $panel->plugins([
        CommentifyPlugin::make(),
        CommentifyProPlugin::make(),
    ]);
}
```

Free-only installs omit `CommentifyProPlugin`.

## Make a model commentable

```php theme={null}
use Usamamuneerchaudhary\Commentify\Traits\Commentable;

class Article extends Model
{
    use Commentable;
}
```

### Livewire (core UI)

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

Pro's spam pipeline, approval, webhooks, and broadcasts run on the `Comment` model, so they apply to Livewire automatically.

### React / Vue (Pro)

Map a URL-safe alias — the API never accepts class names:

```php theme={null}
// config/commentify-pro.php
'commentables' => [
    'articles' => \App\Models\Article::class,
],
```

```tsx theme={null}
import { CommentThread } from "@commentify/react";

<CommentThread type="articles" id={article.id} loginUrl="/login" />
```

The React and Vue SDKs ship **inside the Composer package** (not npm). The installer copies them to `resources/js/vendor/commentify/` and adds `file:` dependencies. Point Tailwind at that path so classes are not purged:

```css theme={null}
@source '../js/vendor/commentify';
```

See [docs.commentify.pro/javascript](https://docs.commentify.pro/javascript) for Vite / React Refresh notes.

## Filament — free plugin

### Comments

View, edit, and delete comments. Likes count, replies count, reports count, commentable type, parent/child, soft deletes.

When `require_approval` is on:

* **Approve** / **Disapprove** on each row
* **Bulk approve / disapprove**
* Filter by approval status (Approved / Pending / All)

### Comment reports

Community reports from the thread kebab menu (`spam`, `inappropriate`, `offensive`, `other`). Review, dismiss, filter by status. Each visitor can report a comment once.

### Commentify Settings

Toggle most core flags from the panel: CSS framework (Tailwind / Bootstrap), theme (light / dark / auto), sorting, reporting, notifications, markdown toolbar/preview, emoji picker, read-only, require approval.

Guest commenting (`allow_guests`) stays in config.

## Filament — Pro plugin

### Moderation queue

Dedicated queue over the same `Comment` model. Navigation badge shows the pending count.

Filters: pending only, has reports, contains links, commentable type.

| Action                                       | Behaviour                                                |
| -------------------------------------------- | -------------------------------------------------------- |
| Approve / Unapprove                          | Sets `is_approved`; writes the audit log                 |
| Ban author                                   | Sets `comment_banned_until` (+30 days) on the user       |
| Pin / Unpin                                  | One top-level pin per thread                             |
| Bulk approve, unapprove, delete, ban authors | All go through `Moderator` so the audit log cannot drift |

### Spam log

Every non-allow spam verdict (`review` or `deny`): excerpt, checker, reasons, user id.

**Not spam** re-approves the matched held comment and submits ham to Akismet when a key is configured.

### Moderation audit

Who did what: `approve`, `unapprove`, `delete`, `ban_author`, `not_spam`, `pin`, `unpin`.

### Widgets

* Pending moderation stat
* Comments per day chart

## Spam pipeline (Pro)

Every comment — Livewire **or** API — is inspected on create and on body edit.

| Verdict    | Result                                             |
| ---------- | -------------------------------------------------- |
| **deny**   | Save aborted. API `422` / `spam_rejected`. Logged. |
| **review** | Saved unapproved. Hidden from the public thread.   |
| **allow**  | Normal flow (still respects `require_approval`).   |

Built-in checkers (run in order; worst verdict wins):

* **heuristic** — link caps, blocked terms/domains, duplicate window, trust after N approved comments. Stricter rules for guests.
* **akismet** — `AKISMET_KEY`. Honours Akismet's discard header.
* **toxicity** — Google Perspective, `COMMENTIFY_PERSPECTIVE_KEY`, hold/deny thresholds.

Write your own by implementing `Usamamuneerchaudhary\CommentifyPro\Contracts\SpamChecker` and listing the class in `spam.checkers`.

## Configuration

Pro publishes **one** file: `config/commentify-pro.php`. Core Commentify keys live under `core` and are copied onto `config('commentify')` at boot.

```php theme={null}
'core' => [
    'user_model' => \App\Models\User::class,
    'pagination_count' => 10,
    'css_framework' => 'tailwind', // or bootstrap
    'comment_nesting' => true,
    'read_only' => false,
    'default_sort' => 'newest',
    'enable_sorting' => true,
    'enable_reporting' => true,
    'theme' => 'auto',
    'enable_emoji_picker' => true,
    'enable_markdown_toolbar' => true,
    'enable_markdown_preview' => true,
    'require_approval' => false,
    'allow_guests' => false,
    'guest' => [
        'require_email' => true,
        'show_gravatar' => true,
    ],
],
```

Avatars: add `HasUserAvatar` on your user model and set `core.user_model`.

Comment bans: add `HasCommentBan` and a `comment_banned_until` column. Filament Pro's **Ban author** uses it.

## JSON API (Pro)

Prefix `commentify/api/v1` (configurable). Pair `api.guard` with `api.middleware` or writes return 401 while reads still work:

| App                                    | `guard`   | `middleware` |
| -------------------------------------- | --------- | ------------ |
| Same-origin Blade / Livewire / Inertia | `web`     | `['web']`    |
| Cross-origin SPA / tokens              | `sanctum` | `['api']`    |

| Method         | Path                    | Purpose                               |
| -------------- | ----------------------- | ------------------------------------- |
| GET            | `ui`                    | Labels, feature flags, auth state     |
| GET            | `{type}/{id}/comments`  | Paginated comments                    |
| POST           | `{type}/{id}/comments`  | Create / reply                        |
| GET            | `comments/{id}/replies` | Nested replies                        |
| PATCH / DELETE | `comments/{id}`         | Edit / delete own                     |
| POST           | `comments/{id}/like`    | Toggle like                           |
| POST           | `comments/{id}/report`  | Report                                |
| POST / DELETE  | `comments/{id}/pin`     | Pin (moderators)                      |
| POST           | `markdown/preview`      | Same HTML as Blade                    |
| GET            | `users?q=`              | @mention autocomplete (auth required) |
| POST           | `media`                 | Image upload when enabled             |

Stable error `code` values: `spam_rejected`, `read_only`, `comment_banned`, `already_reported`, `nesting_disabled`, `parent_mismatch`, `cannot_pin_reply`.

## Other Pro features

* **Guests** — name + email posting is a core MIT flag (`allow_guests`). Pro adds stricter spam and API/SDK fields. Guests cannot edit or delete.
* **Mail** — reply, @mention, thread subscriptions (`subscribe_to_replies`), signed unsubscribe, `php artisan commentify:digest-moderators`.
* **Media** — GIF / JPEG / PNG / WebP, per-role size and rate limits, optional S3 bucket.
* **Reverb** — `COMMENTIFY_REALTIME=true` broadcasts approved creates and likes on `commentify.{alias}.{id}`.
* **Webhooks** — queued JSON POSTs for `pending`, `report`, `spam_deny`.
* **Badges & pins** — author / staff / guest badges; one pinned parent per thread.
* **Import** — `php artisan commentify:import-disqus` and `commentify:import-wordpress` (idempotent via `import_source` + `import_id`; requires `allow_guests`).
* **GDPR** — `commentify:gdpr-export`, `commentify:gdpr-erase`, `commentify:gdpr-anonymize-ips`.

## Pricing

| Plan     | Price                        | Projects             |
| -------- | ---------------------------- | -------------------- |
| Personal | $59, renews $49              | 1 production project |
| Business | $149, renews $99             | Up to 5              |
| Forever  | \$499 one-time (launch-only) | Unlimited            |

The React and Vue SDKs are included in the Composer package. One license covers PHP and JavaScript.

## Support

Email [hello@usamamuneer.me](mailto:hello@usamamuneer.me).

Full documentation: [docs.commentify.pro](https://docs.commentify.pro)
