Files
preregister/config/preregister.php
bert.hausmans 17e784fee7 feat: E.164 phone validation and storage with libphonenumber
- Add giggsey/libphonenumber-for-php, PhoneNumberNormalizer, ValidPhoneNumber rule

- Store subscribers as E.164; mutator normalizes on save; optional phone required from form block

- Migration to normalize legacy subscriber phones; Mailwizz/search/UI/tests updated

- Add run-deploy-from-local.sh and PREREGISTER_DEFAULT_PHONE_REGION in .env.example

Made-with: Cursor
2026-04-04 14:25:52 +02:00

36 lines
1.2 KiB
PHP

<?php
declare(strict_types=1);
$env = env('APP_ENV', 'production');
$defaultPerMinute = in_array($env, ['local', 'testing'], true) ? 1000 : 60;
return [
/*
|--------------------------------------------------------------------------
| Default phone region (ISO 3166-1 alpha-2)
|--------------------------------------------------------------------------
|
| Used when parsing numbers without a country prefix (e.g. national format).
| Override with PREREGISTER_DEFAULT_PHONE_REGION in .env.
|
*/
'default_phone_region' => strtoupper((string) env('PREREGISTER_DEFAULT_PHONE_REGION', 'NL')),
/*
|--------------------------------------------------------------------------
| Public routes rate limit
|--------------------------------------------------------------------------
|
| Max requests per minute per IP for the public landing page and subscribe
| endpoint. Local and testing use a high default so refresh-heavy dev work
| does not hit 429. Override with PUBLIC_REQUESTS_PER_MINUTE in .env.
|
*/
'public_requests_per_minute' => (int) env('PUBLIC_REQUESTS_PER_MINUTE', (string) $defaultPerMinute),
];