Weave Code
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

Laravel Phone Laravel Package

propaganistas/laravel-phone

Add Google libphonenumber-powered phone number validation and utilities to Laravel. Validate numbers by country (static list or matching a companion country field), cast attributes, format and compare numbers, and access phone metadata using a simple PhoneNumber class.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Core Feature Development:

    • Implement global phone number validation for user signups, customer profiles, or service subscriptions (e.g., telemedicine, ride-sharing, or telecom platforms).
    • Enable country-specific phone number validation (e.g., enforce US/UK/EU formats for regional compliance or localized UX).
    • Add phone number type filtering (e.g., restrict to mobile-only for SMS verification or fixed-line for business contacts).
  • Roadmap Priorities:

    • Phase 1: Integrate into user authentication (e.g., phone-based logins) with validation and formatting.
    • Phase 2: Extend to customer support (e.g., store formatted numbers for outbound calls/SMS) and analytics (e.g., track call types like mobile/fixed-line).
    • Phase 3: Enable search/filtering by phone number (e.g., for CRM systems) using the package’s searchable variants.
  • Build vs. Buy:

    • Buy: Avoid reinventing phone parsing/validation logic (libphonenumber is battle-tested by Google).
    • Customize: Extend the package for niche needs (e.g., toll-free number detection, carrier lookup via APIs).
    • Avoid: Rolling out ad-hoc regex solutions or third-party SaaS for phone validation (cost, latency, or vendor lock-in).
  • Use Cases:

    • B2C: E-commerce (international shipping contacts), food delivery (driver/customer numbers), or dating apps (verification).
    • B2B: SaaS platforms (admin/contractor phone storage), logistics (tracking shipments via phone-based updates).
    • Regulatory: Healthcare (HIPAA-compliant patient contact storage) or finance (KYC phone validation).

When to Consider This Package

Adopt This Package If:

  • Your Laravel app requires robust phone number handling (validation, formatting, storage, or comparison).
  • You need international support (e.g., users in 100+ countries) without manual country-specific logic.
  • Data integrity is critical (e.g., avoid duplicate/malformed numbers in databases).
  • You want to reduce frontend/backend validation duplication (e.g., validate once in Laravel, reuse formatted numbers everywhere).
  • Your team lacks expertise in phone number parsing (libphonenumber handles edge cases like ITU-T E.164, national formats, and carrier types).
  • You’re building a scalable system where phone numbers are core to user identity (e.g., WhatsApp-style apps) or operations (e.g., call centers).

Look Elsewhere If:

  • You’re using a non-Laravel stack (e.g., Django, Node.js) or need a language-agnostic solution.
  • Your use case is trivial (e.g., storing raw strings with no validation/formatting).
  • You need real-time carrier/call analytics (e.g., spam detection, number reputation)—consider integrating with a telecom API (e.g., Twilio Lookup).
  • You’re constrained by database schema (e.g., legacy systems with no room for E.164 or searchable variants).
  • Your app is highly regulated (e.g., telecom carriers) and requires custom carrier-specific rules beyond libphonenumber’s scope.

How to Pitch It (Stakeholders)

For Executives:

"This package lets us handle phone numbers like a first-class citizen in our Laravel app—no more hacky regex or manual parsing. It’s built on Google’s libphonenumber, the gold standard for phone validation, and gives us:

  • Global scalability: Validate and format numbers from any country automatically.
  • Data quality: Reject invalid numbers upfront (e.g., block toll-free numbers for customer support).
  • User experience: Store numbers in a normalized way (E.164) but display them as users input them (e.g., +1 (800) 555-1234800-555-1234 for US users).
  • Future-proofing: Supports advanced use cases like phone-type filtering (mobile vs. landline) or searchable phone variants for CRM tools. It’s a drop-in solution that saves dev time and reduces errors—like using a pre-built phone keypad instead of reinventing the wheel."

For Engineers:

"Laravel-Phone integrates seamlessly with our stack and gives us:

  • Validation: Use phone:US,BE in Laravel’s validation rules or chain methods like ->country(['US', 'BE'])->type('mobile') for granular control.
  • Casting: Automatically convert phone strings to PhoneNumber objects in Eloquent models (e.g., $user->phone->formatNational()).
  • Utility Methods: Format numbers for dialing (formatForMobileDialingInCountry('NL')), check types (isOfType('mobile')), or compare equality across formats.
  • Database Flexibility: Choose between raw storage (preserve user input) or E.164 (enforce uniqueness globally). Add searchable variants for complex queries. It’s lightweight (~1MB), MIT-licensed, and actively maintained (last release: 2026). The demo shows real-world behavior, and the libphonenumber backend handles edge cases we’d otherwise debug for years."

For Design/UX Teams:

"This package ensures phone numbers work consistently across the app:

  • Input: Users can enter numbers in any format (e.g., 0123456789, +44 20 1234 5678, 1-800-FLOWERS), and we’ll normalize them internally.
  • Display: Show numbers in their ‘natural’ format for the user’s locale (e.g., +33 1 23 45 67 89 for France).
  • Validation: Clear error messages for invalid numbers (e.g., ‘Please enter a valid US number’). No more ‘Does this number work?’ support tickets—we validate upfront and store data cleanly."
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.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport