mlocati/idna
Pure-PHP implementation of IDNA 2008 and UTS #46 for converting internationalized domain names between Unicode and ASCII (punycode). Validates and normalizes domain names, supports PHP 5.3+, and works without the intl extension, making it a lightweight drop-in for encoding/decoding IDN domains.
A TPM should treat mlocati/idna as a narrow, composable domain-name utility rather than a Laravel feature package. Its fit is strongest where the product must validate, canonicalize, or convert internationalized domain names: email-domain validation, tenant/custom-domain onboarding, SSO/domain allowlists, URL ingestion, marketplace storefront domains, and anti-abuse checks.
intl/ICU behavior. Invalid-input handling and exception behavior must be proven before production use.ext-intl/ext-mbstring? Which IDNA mode and Unicode normalization form does it enforce? How are invalid labels, overlong domains, and mixed-script domains handled? What is the test coverage and security policy? How does output compare with idn_to_ascii/idn_to_utf8 for your existing inputs? Who owns upstream maintenance, and what is the release/backward-compatibility history?TPM recommendation: proceed only as a scoped utility with an internal adapter and conformance tests. Do not let the package become the product’s source of truth for email validity, URL safety, or anti-phishing policy.
IdnaNormalizer/DomainCanonicalizer interface in a Laravel service provider. Expose only application-level methods such as toAsciiDomain(), toUnicodeDomain(), and isValidDomain(). Use it in custom validation rules, form requests, onboarding services, and domain-allowlist logic, not directly in controllers or Eloquent models.idn_to_ascii, idn_to_utf8, regex domain checks, and ad hoc punycode handling. Implement the adapter beside existing logic, run shadow comparisons on representative production inputs, then switch behind a feature flag. If stored domains are not canonical today, plan a read-repair or backfill with idempotent normalization and duplicate detection before enforcing uniqueness.ext-intl remains a fallback or comparison oracle. Standardize on one canonical storage form, normally ASCII/punycode for keys and uniqueness, with Unicode only for display. Ensure validation rules distinguish domain validation from full email validation; IDNA applies to the domain portion, not the local part.intl or transitional IDNA behavior can cause environment-specific results. Invalid input may surface as exceptions or silent rejection depending on wrapper design.How can I help you explore Laravel packages today?