# Paid Content (`larablog/paid-content`)

Sell individual articles with a teaser (trial) and checkout through `larablog/payment`.

## Prerequisites

1. Enable **Payment** (`larablog/payment`) first — this plugin declares it as a hard dependency.
2. Run migrations so `article_products` (and payment tables) exist:

```bash
php artisan migrate
```

3. Enable **Paid Content** in Admin → Plugins.

## Configure an article

1. Open Admin → Articles → create/edit an article.
2. In the **Paid content** section:
   - Turn on paid content
   - Set price and currency (default `CNY`)
   - Set trial length in characters (default `200`; applied after HTML render)
3. Save.

**Note:** Read password and paid content cannot both be enabled. Use password for private sharing; use paid content for selling.

## Frontend paywall

- Readers without an entitlement see a teaser plus a purchase CTA (`need_purchase`).
- Checkout URL points at `/plugins/payment/checkout` with product metadata; Stub payment (or a real gateway later) grants an entitlement.
- After payment, returning to the article shows full content for that logged-in user.
- Authors and users with the `admin` role always see full content (core `ArticleAccess`).

## Disable

Disable this plugin to remove the Filament paid section / column and the `article.access` paywall. Existing `article_products` rows remain until you clean them up manually.
