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:
@@ -108,6 +108,19 @@ class PreregistrationPage extends Model
|
||||
return (bool) $this->phone_enabled;
|
||||
}
|
||||
|
||||
/**
|
||||
* When the form block marks the phone field as required (only applies if phone is enabled).
|
||||
*/
|
||||
public function isPhoneFieldRequiredForSubscribers(): bool
|
||||
{
|
||||
$form = $this->getBlockByType('form');
|
||||
if ($form !== null) {
|
||||
return (bool) data_get($form->content, 'fields.phone.required', false);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public function headlineForMeta(): string
|
||||
{
|
||||
$hero = $this->getHeroBlock();
|
||||
|
||||
Reference in New Issue
Block a user