# Upgrade — Feature Extensions (migration 008)

This release adds twelve discovery/privacy features plus admin-managed
subscription packages. It is **additive**: no existing table is dropped or
renamed, and migration `008` is idempotent (safe to run on your live
database, and safe to re-run).

## Deploy steps

1. **Back up first** (always, before any migration):
   ```
   mysqldump -u <user> -p <db> > backup-before-008.sql
   ```
2. **Upload the changed files** over your existing install (or replace the
   whole project folder — your `.env` and `storage/` are untouched).
3. **Run the migration** from the project root:
   ```
   php bin/migrate.php migrate
   ```
   Only `008_feature_extensions.php` will apply. It adds columns to
   `profiles`, `users` and `packages`, creates a few indexes, and publishes
   the Safety Guide page. You do **not** need to re-run `seed`.
4. Done. No cache to clear.

If your host has no shell, apply `database/migrations/008_feature_extensions.php`'s
SQL equivalent via phpMyAdmin, or ask your host to run the command.

## What's new

**Privacy**
- Two-tier profile visibility (Public vs Private). Private profiles are
  masked in search and reveal full detail + contact only after a mutual
  accepted interest.
- Field-by-field visibility (public / connections-only / hidden) per detail.
- Optional photo blurring — stay browsable while photos are blurred until you
  connect. Set under Profile → Privacy & Visibility.

**Verification & trust**
- Every profile is still admin-verified before going live; admins can now
  grant an **Enhanced Verified** tier (extra checks) from Admin → Users.
- A published, plain-language **Safety Guide** (linked in the top nav and
  footer, `/page/safety`).

**Discovery**
- Homepage category quick-links: Grooms, Brides, Divorced Grooms, Divorced
  Brides, Abroad Proposals — plus a compact quick-search box.
- Quick Search vs Advanced Search split (`/search` and `/search/advanced`).
- Explicit district dropdown **and** city filter; a dedicated **Abroad** mode
  for overseas members (set on the profile's personal section).
- Compatibility scoring (a two-way %), shown on cards and profiles, beyond
  plain filter matching.
- Promoted/Premium top placement: granted automatically by a package's
  `promoted_days`, or manually from Admin → Users → Promote.

**Accounts**
- Multi-child profile management: one guardian account can create and manage
  several profiles and switch between them (Member → Managed Profiles).

**Admin**
- Full subscription-package management (Admin → Packages): create, edit and
  enable/disable packages — price, duration, interest quota, recommendation
  cap, feature flags and promotion days — all at runtime, no redeploy.

## Note on managed (child) profiles
A managed profile is a full member record linked to its guardian. It is given
synthetic, unique internal credentials (it has no independent login); the
guardian acts on its behalf and remains the point of contact. Each managed
profile still goes through payment and admin approval like any other.
