mpetrini/phone-number-bundle
A Symfony bundle for parsing, validating, and formatting international phone numbers using Google's libphonenumber library. Provides Twig filters, form types, and validator constraints, plus a service for phone number handling in your Symfony applications.
Feature bets this informs. Any surface where a user types, imports, or receives a phone number: signup/onboarding with phone verification, SMS OTP and 2FA, international checkout with contact capture, CRM/contact imports, notification routing (SMS vs. voice vs. push fallback), and fraud/abuse screening. The capability underneath is always the same three primitives — parse, validate, normalize to E.164 — plus locale-aware display formatting and line-type detection (mobile / fixed / VoIP).
Roadmap: market expansion. Phone validation is a gating dependency for launching in new countries. If we can't validate and normalize a Brazilian or Indian number, we can't onboard those users or price SMS correctly. The metadata coverage of libphonenumber, not the wrapper, is what determines which markets are addressable.
Build vs. buy. The real decision is "adopt libphonenumber vs. hand-roll." Hand-rolling prefix/carrier rules is indefensible — the rules change constantly and Google maintains the canonical dataset. But this package is only a thin Symfony DI/config wrapper over that dataset. The build cost to replicate the wrapper is roughly a day; the buy value is concentrated entirely in the dependency, not the wrapper.
Direct cost lever. Validating before dispatch avoids paying an SMS provider for numbers that were never deliverable. That gives a measurable, per-market ROI number for what is otherwise a "hygiene" ticket — useful for prioritization.
Concrete use cases to cite in a spec: normalize to E.164 before persistence; reject invalid input at the edge rather than at send time; format for display per user locale; extract a number from pasted free text; route OTP over SMS only for mobile line types; block known VoIP/virtual ranges on high-risk flows.
Consider it only if:
Look elsewhere if:
propaganistas/laravel-phone, or bind giggsey/libphonenumber-for-php behind your own service in a provider.odolbeau/phone-number-bundle or the underlying library directly.What would change the verdict: a maintained fork, Symfony 6/7 support, a release within the last 12 months, CI with tests, and at least one real dependent. None of those hold today.
Flag before proceeding: the package is described upstream as a Symfony bundle. If this evaluation was requested as a Laravel integration, the premise is wrong and the correct candidate is propaganistas/laravel-phone — worth confirming before any further work.
For executives. Phone handling is a data-quality and cost-control problem, not a UI nicety. The capability we need — turning messy international input into one canonical format, validating numbers before we pay a messaging provider, and displaying them correctly per market — comes from libphonenumber, Google's industry-standard dataset. This package is a small adapter around that library for an older Symfony version: last released in 2020, no adoption, no maintenance signal, and not built for our stack. Recommendation: adopt the underlying library (or a maintained framework adapter), not this package. The engineering cost either way is on the order of a day; the actual risk is inheriting an abandoned wrapper and discovering it during a market launch.
For engineering. Treat the wrapper as replaceable, not strategic. Consume giggsey/libphonenumber-for-php behind our own PhoneNumber interface with four methods — parse, validate, format, lineType — so a future adapter swap is a one-file change. The genuine ongoing cost is metadata currency: pin the library, subscribe to its release cadence, and decide now whether metadata updates ride the normal dependency-upgrade train or need a scheduled job. That cost exists regardless of which wrapper we pick, so it should be the deciding factor rather than the wrapper's ergonomics.
For product. Budget one day of engineering for the integration plus a small recurring allowance for metadata updates. If the wrapper is used at all, use it on legacy Symfony surfaces only and record it as technical debt with an owner and a replacement trigger.
How can I help you explore Laravel packages today?