whisper-money/config
Víctor Falcón 58b934333f
feat: centralize pricing config with multiple plans support (#20)
## Summary

Centralizes all pricing/subscription plan configuration in a single PHP
config file, making it easy to modify prices, features, and promotional
codes from one place.

## Changes

### Config (`config/subscriptions.php`)
- Added `plans` array with support for multiple billing cycles (monthly,
yearly, lifetime)
- Each plan includes: name, price, original_price (for discounts),
stripe_price_id, billing_period, and features
- Added `default_plan` setting to control which plan is highlighted
- Added `promo` config with enabled flag, code, description, and badge

### Frontend
- Created TypeScript types for `Plan`, `PromoConfig`, and
`PricingConfig`
- Updated `welcome.tsx` to display all plans in a responsive grid layout
- Updated `paywall.tsx` to show all plans with "Most Popular" and "Best
Value" badges
- Promo code section is now conditionally rendered based on
`promo.enabled`

### Backend
- Updated `HandleInertiaRequests.php` to share pricing config globally
- Removed redundant props from routes

### Tests
- Added test to verify pricing config structure is passed correctly

## How to Use

To modify pricing, edit `config/subscriptions.php`:
- Change `default_plan` to highlight a different plan
- Set `promo.enabled` to `false` (or `PROMO_ENABLED=false` in `.env`) to
hide promo codes
- Add/remove/modify plans as needed
2025-12-09 10:03:35 +01:00
..
app.php Set up a fresh Laravel app 2025-11-07 12:01:36 +00:00
auth.php Set up a fresh Laravel app 2025-11-07 12:01:36 +00:00
cache.php Set up a fresh Laravel app 2025-11-07 12:01:36 +00:00
cashier.php Subscriptions (#15) 2025-12-06 19:09:56 +01:00
database.php Set up a fresh Laravel app 2025-11-07 12:01:36 +00:00
filesystems.php Set up a fresh Laravel app 2025-11-07 12:01:36 +00:00
fortify.php Set up a fresh Laravel app 2025-11-07 12:01:36 +00:00
inertia.php Set up a fresh Laravel app 2025-11-07 12:01:36 +00:00
landing.php Add lead tracking webhook implementation 2025-11-25 12:13:29 +01:00
logging.php Set up a fresh Laravel app 2025-11-07 12:01:36 +00:00
mail.php Set up a fresh Laravel app 2025-11-07 12:01:36 +00:00
queue.php Set up a fresh Laravel app 2025-11-07 12:01:36 +00:00
services.php Set up a fresh Laravel app 2025-11-07 12:01:36 +00:00
session.php Set up a fresh Laravel app 2025-11-07 12:01:36 +00:00
subscriptions.php feat: centralize pricing config with multiple plans support (#20) 2025-12-09 10:03:35 +01:00