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 Laravel Package

laravel-validation-rules/phone

Add reliable phone number validation to your Laravel apps with dedicated rules that verify international formats and reject invalid numbers. Simple, expressive syntax for form requests and validators keeps user data clean.

View on GitHub
Deep Wiki
Context7

Validate phone number format

Frequently asked questions about Phone
How do I install laravel-validation-rules/phone in a Laravel app?
Install it with Composer using composer require laravel-validation-rules/phone. After that, publish any bundled configuration file if the package ships one, which is where you would normally set a default region for nationally formatted input. Then attach the rule to the relevant FormRequest classes or inline validators. The whole integration is stateless and typically takes minutes rather than a sprint.
Which Laravel and PHP versions does laravel-validation-rules/phone support?
The package overview does not publish a version matrix, so check the composer.json constraints and the README before committing. Confirm the required PHP version and the Laravel illuminate/validation and illuminate/support ranges match your application. If you maintain older Laravel releases, verify compatibility in a branch before rolling it out. Pinning a known-good version avoids surprises during framework upgrades.
How do I use the phone rule in a Laravel form request or Validator::make call?
The package is built around dedicated rule objects, so you attach the phone rule to a field in your rules array just like any other Laravel validation rule. That works the same way inside a FormRequest rules() method, an inline Validator::make call, Fortify or Breeze registration flows, Livewire components, and Nova or Filament resource forms. Because it plugs into the standard Validator contract, no service provider wiring or architectural changes are needed.
Can it validate international phone numbers from multiple countries?
Yes, the package is designed to verify international phone number formats rather than a single country's pattern. Parsing is handled by libphonenumber, so numbers in full international form are checked against the correct country's numbering plan. For national-format input you should configure a default region, but be careful: hardcoding one country is a quiet bug for international audiences. Prefer deriving the region from the user's locale or an explicit country selector.
Does the rule return a normalized E.164 value or only validate?
Validation and canonicalization are separate concerns, and the package is described primarily as a validation rule. Do not assume it returns a normalized value; verify the API before relying on it for storage. If it validates only, add an explicit normalization step with libphonenumber so you store a consistent E.164 format. Mixed formats at rest will break deduplication, lookups, and downstream SMS or voice vendors.
Does a passing validation rule mean the phone number can actually receive SMS or calls?
No. The rule answers whether a number is structurally plausible for its region, not whether it is reachable, active, or owned by the user. Scope that distinction explicitly with stakeholders, because people often conflate format validation with deliverability. If you need reachability, add an OTP or verification step on top of validation.
What happens when a user enters an invalid or ambiguous phone number?
Because it is a Laravel validation rule, invalid input should produce a standard validation failure and an error message rather than an uncaught exception. Ambiguous input is more subtle: whether the rule fails open or closed depends on the default region and the underlying parser behavior. Test representative edge cases from your target markets, including short national numbers and numbers with extensions, before shipping. Agree in advance whether your policy is strict rejection or normalize-and-accept.
Are phone validation error messages translatable?
Laravel validation rules accept custom messages and attribute names, so you can supply localized text through your language files or the messages array. Check the package README for any bundled translation set and for the exact message keys it uses. For multi-locale applications, plan to override the messages explicitly rather than relying on defaults. That keeps error copy consistent with the rest of your form validation.
How does laravel-validation-rules/phone compare to propaganistas/laravel-phone?
propaganistas/laravel-phone is the established incumbent with materially larger adoption, so it is the safe ecosystem default. Choose this package only if its ergonomics, Laravel version support, or message handling are clearly better for your team, and document that reasoning in the pull request. Both sit on libphonenumber, so parsing accuracy is largely equivalent. If the difference is marginal, avoid a gratuitous deviation and use the more widely adopted option.
How do I keep phone number metadata current, and is the package safe for production?
Phone numbering plans change constantly, and correctness depends on the libphonenumber metadata that arrives through dependency updates. Schedule regular composer update runs and review the lockfile diff so you do not silently pin stale metadata that rejects new ranges or accepts retired ones. The package itself is a thin, stateless rule with a small blast radius, which makes it easy to fork or replace with an inline Rule object. Note that it has a single primary maintainer and ships under Apache-2.0 without warranty, so pin versions and keep your own test coverage around critical flows.
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.
frankyso/ipaymu
3mdikram/worldmoneywords
snowsoft/config
itmosoft/laravel-subscriptions
larva/laravel-ai-qwen
diephp/sequences
users-au/socialite-provider
twidpay/twid-logger
mrnewport/laravel-plaid
mrnewport/laravel-repo
mrnewport/laravel-docsign
mrnewport/laravel-stow
mrnewport/laravel-flow
mrnewport/laravel-priceable
mrnewport/laravel-nestedterms
fredmeng/laravel-apidoc-generator
itstructure/laravel-multilingual-tools
pdustdar/elasticsearch
markupai/php-sdk
rlacerda83/lumem-microservice-shipment