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

# Install Commentify Pro

> Add the private Composer repository, require the package, and run the interactive commentify-pro:install command.

## Prerequisites

* PHP 8.2+
* Laravel 12 or 13
* A [Commentify Pro license](https://checkout.anystack.sh/commentify-pro) (Composer credentials from Anystack)
* The open-source Commentify package is installed automatically as `usamamuneerchaudhary/commentify:^4.0`

If you only want the MIT Livewire thread, install [core from Packagist](https://packagist.org/packages/usamamuneerchaudhary/commentify) instead. Pro is the API, SDKs, and spam layer on top of that same table.

## Install the package

<Steps>
  <Step title="Point Composer at the private repo">
    After checkout, Anystack gives you credentials for the Composer repository:

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

    Use the license key / HTTP basic auth from your Anystack order when Composer asks. This is the only license check — production requests do not phone home.
  </Step>

  <Step title="Run the interactive installer">
    ```bash theme={null}
    php artisan commentify-pro:install
    ```

    The installer asks:

    1. **Frontends** — Livewire, React, and/or Vue. The JSON API is always installed; this only affects scaffolding.
    2. **Guard** — `web` (session cookies) or `sanctum` (SPA cookies or tokens). See [Authentication](/authentication) before you override this.
    3. **Spam checkers** — `heuristic` (default), optional `akismet` and `toxicity`.
    4. **Commentable models** — scans `app/Models` for the `Commentable` trait and writes aliases into `commentables`.
    5. **Migrations** — creates `commentify_spam_logs`, `commentify_mod_actions`, `commentify_subscriptions`, and adds `pinned_at` on `comments`.

    It publishes **one** config file, `config/commentify-pro.php`. Core Commentify settings live under the `core` key. It is safe to re-run. Values you have customised are left alone and printed as next steps.
  </Step>

  <Step title="Finish JavaScript (React / Vue only)">
    If you picked React or Vue, the installer copies the SDKs to `resources/js/vendor/commentify/` and adds local `file:` dependencies to `package.json`. Then:

    ```bash theme={null}
    npm install
    npm run build
    ```

    Point Tailwind at the published SDK so classes are not purged. The installer adds this to `resources/css/app.css` when it can:

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

    See [How the JavaScript ships](/javascript).
  </Step>
</Steps>

## Scripted installs

Every prompt has a matching option:

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

| Option         | Meaning                                                               |
| -------------- | --------------------------------------------------------------------- |
| `--frontend=*` | Repeatable: `livewire`, `react`, `vue`                                |
| `--guard=`     | `web` or `sanctum`                                                    |
| `--css=`       | `tailwind` or `bootstrap` (Livewire views)                            |
| `--spam=*`     | Repeatable: `heuristic`, `akismet`, `toxicity`                        |
| `--migrate`    | Run migrations without asking                                         |
| `--no-migrate` | Skip migrations                                                       |
| `--force`      | Overwrite config, views, and the scaffolded `CommentThread` component |

Non-interactive default frontend is Livewire. Default spam checker is `heuristic`. Default guard is `web` unless Sanctum is installed **and** Livewire is not in the frontend list.

## What the installer writes

* `config/commentify-pro.php` — unless it already exists (use `--force` to replace)
* API `guard` + matching `middleware` group
* `spam.checkers`
* `commentables` aliases (plural kebab of the class basename, e.g. `Article` → `articles`)
* Livewire views under `resources/views/vendor/commentify` when you pick Livewire
* `resources/js/components/CommentThread.tsx` or `.vue` (never overwritten unless `--force`)
* Published SDK under `resources/js/vendor/commentify/` (always refreshed — treat it as vendor)
* `@source` in `resources/css/app.css` when the file looks like Tailwind v4
* `AKISMET_KEY` in `.env` if you enable Akismet and paste a key

It **detects** Filament rather than rewriting your panel provider. If Filament is installed and `CommentifyProPlugin` is missing, it prints the snippet to add. See [Filament](/filament).

## Manual installation

Prefer to wire things by hand? This is what the installer automates:

```bash theme={null}
php artisan vendor:publish --tag=commentify-pro-config
php artisan vendor:publish --tag=commentify-pro-js --force
php artisan migrate
```

Optional core publishes (only if you need to customize views or lang):

```bash theme={null}
php artisan vendor:publish --tag=commentify-tailwind-views
php artisan vendor:publish --tag=commentify-bootstrap-views
php artisan vendor:publish --tag=commentify-lang
```

Then set `commentables`, pair `api.guard` with `api.middleware`, and add the `@source` directive. Continue with [Usage](/usage) to attach the trait and drop a thread on the page.

<Warning>
  If `config/commentify.php` already exists from a free-package install, **that file wins**. Merge those keys into `commentify-pro.core` and delete `config/commentify.php`, or Pro's overlay will never apply. The installer warns you.
</Warning>

<Tip>
  Next: [pick a guard](/authentication) before you wire React or Vue. A mismatched guard looks like "reads work, every write is 401".
</Tip>
