whisper-money/app/Http/Middleware
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
..
DisableRegistrationWhenHidden.php Hide GitHub and Discord link text on mobile in header 2025-12-06 20:35:09 +01:00
EnsureUserIsSubscribed.php Subscriptions (#15) 2025-12-06 19:09:56 +01:00
HandleAppearance.php Set up a fresh Laravel app 2025-11-07 12:01:36 +00:00
HandleInertiaRequests.php feat: centralize pricing config with multiple plans support (#20) 2025-12-09 10:03:35 +01:00
RedirectToEncryptionSetup.php E2E Encryption 2025-11-07 14:21:25 +00:00
WithoutSsr.php Disable SSR for dashboard routes and extract API routes (#19) 2025-12-08 19:21:48 +01:00