# Environment variables

Copy `.env.example` to `.env`. Never commit `.env`. Secrets live only here — never in the admin settings table.

| Variable | Purpose | Production value |
|---|---|---|
| `APP_NAME` | Store name fallback | `BeAuthentic` |
| `APP_ENV` | `local` / `production` | `production` |
| `APP_KEY` | Encryption key (`php artisan key:generate`) | generated |
| `APP_DEBUG` | Stack traces | **`false`** |
| `APP_URL` | Canonical URL (sitemap, emails, Paystack callback) | `https://beauthentic.ng` |
| `APP_TIMEZONE` | App timezone | `Africa/Lagos` |
| `DB_CONNECTION` … `DB_PASSWORD` | Database | `mysql` + cPanel DB credentials |
| `SESSION_DRIVER` | Sessions | `database` |
| `SESSION_SECURE_COOKIE` | HTTPS-only cookies | leave unset — on automatically in production |
| `CACHE_STORE` | Cache | `database` (or `file`) |
| `QUEUE_CONNECTION` | Queue | `database` |
| `QUEUE_PROCESSING_STRATEGY` | `cron` (scheduler drains the queue every minute) or `worker` (you run a supervised worker) | `cron` |
| `MEDIA_PUBLIC_DISK` | Catalogue images | `public` (or `s3`) |
| `MEDIA_PRIVATE_DISK` | Customer uploads (never public) | `private` (or a private S3 disk) |
| `AWS_*` | S3-compatible storage (e.g. Cloudflare R2) | optional |
| `MAIL_*` | SMTP | cPanel mailbox or provider |
| `PAYSTACK_PUBLIC_KEY` / `PAYSTACK_SECRET_KEY` | Paystack (Phase 2) | live keys |
| `PAYSTACK_CALLBACK_URL` | Return URL after payment | `${APP_URL}/checkout/callback` |
| `AI_PROVIDER` | `disabled`, `openai`, `replicate` (`fake` is local-only and refuses production) | `disabled` until configured |
| `AI_API_KEY` | Provider API key — optional: can be entered in Admin → AI Try-On instead (stored encrypted, overrides this) | secret |
| `AI_PROVIDER_MODEL` | e.g. `gpt-image-1` or `owner/model` on Replicate | provider-specific |
| `AI_PROVIDER_BASE_URL` | Override API base URL | usually blank |
| `AI_WEBHOOK_SECRET` | Replicate webhook signing secret (`whsec_…`) | secret |
| `AI_REQUEST_TIMEOUT` | Seconds to wait for a provider | `90` |
| `AI_DISPATCH` | `after_response` (cPanel), `queue`, `sync` | `after_response` |
| `CRM_DRIVER` | `null` (off), `webhook`, `fluentcrm` | `null` until configured |
| `CRM_WEBHOOK_URL`, `CRM_WEBHOOK_SECRET` | webhook driver: HTTPS endpoint and signing secret | secret |
| `CRM_FLUENTCRM_URL`, `CRM_FLUENTCRM_USERNAME`, `CRM_FLUENTCRM_APP_PASSWORD` | FluentCRM site, WordPress user and application password | secret |
| `CRM_FLUENTCRM_LIST_IDS`, `CRM_FLUENTCRM_TAG_PREFIX` | lists to add contacts to (comma-separated IDs), tag prefix (`ba-`) | optional |
| `CRM_INBOUND_SECRET` | verifies `POST /webhooks/crm` | secret |
| `OUTBOUND_WEBHOOK_SECRET` | signs campaign webhooks (falls back to a key derived from `APP_KEY`) | secret |
| `MAIL_MARKDOWN_THEME` | email theme | `beauthentic` |
| `SEED_ADMIN_EMAIL` / `SEED_ADMIN_PASSWORD` / `SEED_ADMIN_NAME` | First admin created by `db:seed` | set once, remove after |
| `TRUSTED_PROXIES` | `*` (or IPs) when behind Cloudflare/a proxy, so HTTPS and visitor IPs are detected | `*` with Cloudflare, else empty |
| `FORCE_HTTPS` | redirect http → https in production | `true` |
| `LOG_STACK`, `LOG_LEVEL`, `LOG_DAILY_DAYS` | daily log files; secrets are masked by `App\Logging\RedactSecrets` | `daily`, `warning`, `14` |
| `BACKUP_DISK` | off-site copy of nightly backups (a disk from `config/filesystems.php`, e.g. `s3`) | `s3` |
| `BACKUP_KEEP_DAYS` | retention, local and off-site | `14` |
| `BACKUP_ARCHIVE_PASSWORD` | AES-256 encryption for backup archives (also enables including `.env`) | long random secret |

Values are read through `config/*.php`, so they keep working after `php artisan optimize` (which caches config and stops `.env` being read at runtime).

