Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Phone Number Bundle Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit — poor for a Laravel codebase. Despite the "Laravel/PHP package" framing, this is a Symfony bundle, not a Laravel package. It ships a Bundle class, DI extension, service definitions, a Symfony validator constraint, a form type, and a Twig extension. Laravel has no bundle loader, so none of that registers. What remains after stripping the Symfony glue is an extremely thin wrapper — roughly a default-region/format config value and three method calls — around giggsey/libphonenumber-for-phone-numbers, the PHP port of Google's libphonenumber. The bundle is not where the value lives; the dependency is.

Integration feasibility — technically trivial, practically pointless. In Laravel you would not install this at all. You would composer require giggsey/libphonenumber-for-phone-numbers, bind a small PhoneNumberService in a service provider, and write a Rule object plus a cast/accessor for E.164 normalization. That is a day of work and gives you full control of the metadata version. Pulling the bundle instead drags symfony/framework-bundle into a Laravel app's dependency graph — a large, unnecessary tree that will fight Laravel's own HTTP kernel-adjacent packages and constrain your Symfony-adjacent transitive versions for no functional gain.

Technical risk — high, and concentrated in abandonment rather than code. Signals: 0 stars, 0 dependents, single maintainer, last release 2020-11-03, and a stated support ceiling of Symfony 2–4 (Symfony 4 reached end of life in November 2023). This is almost certainly a personal fork of misd/phone-number-bundle; forks with zero downstream consumers receive no issue triage, no security response, and no CVE monitoring. The most under-appreciated risk is phone metadata staleness: numbering plans change continuously — new area codes, MNP range reassignments, country code splits. Metadata freshness comes entirely from the underlying giggsey library. If the bundle pins or constrains that dependency, you are blocked from bumping metadata without forking the bundle yourself, which defeats the purpose of using a bundle. Secondary risk: PHP version constraints from 2020 may cap you below PHP 8.2/8.3, and old constraint syntax has a habit of failing to resolve against modern Composer dependency graphs.

Key questions for the maintainer/sponsor:

  1. Why does this fork exist relative to misd/phone-number-bundle, and what does it change? (If the diff is trivial, the fork is pure liability.)
  2. Which giggsey version constraint does it declare, and does it allow current metadata releases?
  3. What is the declared PHP and Symfony constraint set, and does it resolve against our PHP 8.2+ target?
  4. Is the license compatible and is there any CLA/attribution obligation carried from upstream?
  5. Who owns phone-number validation on our side if this dependency is unmaintained — is there a named engineer and a quarterly metadata-bump calendar entry?

Integration Approach

Stack fit: do not adopt the bundle. For a Laravel target the correct decision is to consume the underlying library directly, or use a maintained Laravel-native wrapper (propaganistas/laravel-phone), which already provides the validation rule, E.164 casting, and Blade/Eloquent ergonomics the Symfony bundle provides in its own ecosystem. Either path eliminates the framework-coupling problem entirely.

Recommended architecture:

  • giggsey/libphonenumber-for-phone-numbers as a direct, unlocked-to-current dependency, bumped on a scheduled cadence for metadata.
  • A thin App\Support\PhoneNumber value object wrapping parse/format/validate, so the library never leaks into controllers or models.
  • A ValidPhoneNumber validation Rule, plus a PhoneNumber Eloquent cast that normalizes to E.164 on write and formats for display on read.
  • Default region and display format as entries in config/phone.php — the one genuinely useful idea borrowed from the bundle's config surface.

Migration path. If an existing Symfony service uses this bundle, the port is mechanical: the parsing/formatting calls are library calls, not bundle calls. Extract them behind an interface in the Symfony app first, then reimplement the adapter on the Laravel side. No data migration is required if storage is already E.164; if it is not, that becomes the real project (see below).

Compatibility and sequencing.

  1. Spike (1–2 days): install giggsey in a branch, verify it resolves against current PHP/Laravel, and confirm metadata version freshness.
  2. Normalize storage contract before writing validators — decide E.164 as the canonical column format and confirm the display-format layer. Validators written against a fuzzy contract get rewritten.
  3. Data audit: count existing phone rows that fail E.164 parse under the new library. This number determines whether backfill is a script or a project. Non-parsing rows are usually free-text legacy input from a country your default region no longer covers.
  4. Roll out validation in write paths first (registration, checkout, profile update), then read paths (display formatting), then backfill.
  5. Decommission any Symfony bundle reference and delete the fork from the dependency graph.

Compatibility note: validate the library resolves cleanly against your Laravel version and PHP target before committing to the plan; libphonenumber PHP ports occasionally require a PHP minor bump for new metadata structures.

Operational Impact

Maintenance — the dominant cost driver, and it is low only because the right answer is to not adopt it. Owning a direct giggsey dependency is a once-per-quarter composer update plus a smoke test on a canned set of numbers per supported region. Owning this bundle means owning a fork of a dead fork whenever the pinned metadata version becomes unacceptable. That is a recurring, unbounded maintenance tax for zero incremental functionality.

Support. With 0 stars and 0 dependents there is effectively no community: no Stack Overflow corpus, no third-party blog posts, no one to ask when behavior diverges. Any issue is yours alone. Budget for the team reading the underlying library's source rather than the bundle's documentation — which is where they would end up anyway.

Scaling. Runtime cost is not a concern at typical volumes. Parsing is regex-heavy but microsecond-scale per number, and metadata is loaded into memory (single-digit MB). Two real scaling concerns: (a) never parse/validate the same number repeatedly in a hot loop — normalize on write and store E.164 so reads are string comparisons; (b) metadata load is per-process, so on high-churn PHP-FPM or serverless cold starts the parse cost is paid on each boot. Both are addressed by the normalize-on-write design, not by the bundle.

Failure modes to design against:

  • Stale metadata → false negatives. A legitimate number from a newly allocated range is rejected at signup. Users do not report this as a bug; they abandon. Mitigate with a metadata-bump calendar entry and a soft-fail path (accept-with-flag) for unparseable numbers where the business can tolerate it.
  • Over-strict validation → false positives on rejection. Validating against a specific line type (mobile vs. fixed-line) when the business only needs "dialable" is a common self-inflicted outage.
  • Composer conflict cascade if the Symfony bundle is introduced into a Laravel app — manifests as unrelated packages failing to resolve, which is expensive to diagnose.
  • Format drift in display after a metadata bump: numbers that formatted one way now format another, breaking snapshot tests and occasionally downstream export contracts.
  • Framework upgrade blockage if any Symfony-coupled code path remains when the next Laravel major lands.

Ramp-up. Low. A mid-level engineer with libphonenumber experience is productive in under a day on the service-object-plus-rule pattern, and the E.164-on-write convention is self-documenting. The only genuine ramp-up burden is archaeology: explaining to the next engineer why a zero-star Symfony bundle fork is in a Laravel composer.json. Avoid creating that artifact.

Recommendation. Reject the bundle. Adopt the underlying libphonenumber port directly (or the maintained Laravel wrapper), normalize to E.164 at the persistence boundary, and put the metadata-refresh cadence on the team's recurring calendar. The bundle's only durable contribution to this decision is its config surface and validation rule design, both of which are cheaper to reimplement than to inherit.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
uni-method/symfony-lib
tacticmedia/scim-server-bundle
neika-ai/symfony-bundle
mattleads/agent-publishing-bundle
glavweb/framework-bundle
glavweb/extra-bundle
glavweb/api-bundle
glavweb/admin-bundle
adachsoft/api-version-bundle
elsayed85/laravel-api-exceptions
ouhssini/laravel-demo-mode
daworks/ncloud-outbound-mailer-driver
gp247/cms
ignibyte/aic-gates
nexa-merchant/blog
novasa/laravel-language-center
opencage/geocode
adolfoholzer/parameters
livenetworks/ln-starter
shitoudev/permissionmanager