whisper-money/app/Http
Víctor Falcón b399aaaa0d
feat(subscriptions): add configurable trial period to paid plans (#324)
## Summary

Adds a 15-day trial to the monthly and yearly plans. Configurable per
plan (or disabled) via config.

## Changes

- `config/subscriptions.php` — new `trial_days` key per plan (defaults:
monthly=15, yearly=15). Env overrides: `STRIPE_PRO_MONTHLY_TRIAL_DAYS`,
`STRIPE_PRO_YEARLY_TRIAL_DAYS`. Set to `0` to disable.
- `SubscriptionController::checkout` — applies `trialDays()` on the
Cashier subscription builder when `trial_days > 0`.
- Tests — assert `trial_days` surfaced in pricing props; assert
`trialDays(15)` applied on checkout; assert skipped when `0`.

## Notes

Stripe Checkout enforces a **minimum 2-day trial**. Values of `1` will
fail at Stripe. `0` disables cleanly.

## Test plan

```
php artisan test --compact tests/Feature/SubscriptionTest.php
```
2026-04-24 14:07:46 +02:00
..
Controllers feat(subscriptions): add configurable trial period to paid plans (#324) 2026-04-24 14:07:46 +02:00
Middleware refactor(real-estate): remove Pennant gating (#308) 2026-04-20 13:31:49 +01:00
Requests refactor(real-estate): remove Pennant gating (#308) 2026-04-20 13:31:49 +01:00
Responses fix: route new PWA guests to signup (#313) 2026-04-21 10:53:05 +01:00