Skip to content

sander3/laravel-phone-number-validation

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
src
 
 
 
 
 
 

Validate a phone number

Scrutinizer Code Quality Latest Stable Version Monthly Downloads License

Using Laravel's powerful validation feature.

Requirements

  • PHP >= 7.1
  • Laravel >= 5.5 or 6.0

Installation

Install the package via the Composer package manager:

$ composer require soved/laravel-phone-number-validation

Usage

You may use the phone number validation as any other validation rule:

<?php

$request->validate([
    'phone_number' => 'required|string|phone_number',
]);

If needed, you may customize the validation error message by adding an entry to the validation language file:

'phone_number' => 'The phone number format is invalid.',

'accepted' => 'The :attribute must be accepted.',

// The rest of the validation error messages...

Security Vulnerabilities

If you discover a security vulnerability within this project, please send an e-mail to Sander de Vos via sander@tutanota.de. All security vulnerabilities will be promptly addressed.

License

This package is open-source software licensed under the MIT license.

About

Validate a phone number using Laravel's powerful validation feature.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages