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
This commit is contained in:
@@ -170,7 +170,7 @@ class PublicPageTest extends TestCase
|
||||
$response->assertJsonValidationErrors(['phone']);
|
||||
}
|
||||
|
||||
public function test_subscribe_normalizes_phone_to_digits(): void
|
||||
public function test_subscribe_stores_phone_as_e164(): void
|
||||
{
|
||||
$page = $this->makePage([
|
||||
'start_date' => now()->subHour(),
|
||||
@@ -189,7 +189,7 @@ class PublicPageTest extends TestCase
|
||||
$this->assertDatabaseHas('subscribers', [
|
||||
'preregistration_page_id' => $page->id,
|
||||
'email' => 'phoneuser@example.com',
|
||||
'phone' => '31612345678',
|
||||
'phone' => '+31612345678',
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user