PHP Classes

Laravel Phone Validation: Laravel service to validate phone numbers

Recommend this page to a friend!

  Author Author  
Picture of Hicri
Name: Hicri <contact>
Classes: 10 packages by
Country: Turkey Turkey
Innovation award
Innovation award
Nominee: 1x


  Detailed description   Download Download .zip .tar.gz  
This package provides a Laravel service to validate phone numbers.

The service class registers a facade class that returns the name of the phone validation class.

The phone validation class can send HTTP requests to the AbstractAPI phone validation API to get details of a given phone number if it is valid.

Details

slvler - Phone Validation

tests Latest Stable Version Latest Unstable Version License

Phone Validation API for app.abstractapi.com

Abstract's Phone Number Validation and Verification API is a fast, lightweight, modern, and RESTful JSON API for determining the validity and other details of phone numbers from over 190 countries.

It's very simple to use: you only need to submit your API key and a phone number, and the API will respond as assessment of its validity, as well as additional details like the carrier details, line type, region and city details, and more.

Validating and verifying phone numbers is a critical step to reducing the chances of low quality data and fraudulent or risky users in your website or application.

Installation

To install this package tou can use composer:

    composer require slvler/phone-validation

Usage

  • First, you should extract the config/phone.php file to the config folder.
    php artisan vendor:publish --tag=phone

  • API key to be obtained from app.abstractapi.com address should be declared. This is your private API key, specific to this API.
    'phone' => [
        'base_url' => 'https://phonevalidation.abstractapi.com/',
        'api_key' => 'XXXXXXXXXXXXXXXXXXXXXXXX'
    ]

  • Abstract's Phone Number Validation and Verification API simply requires your unique API key and the phone number you'd like to check:
    use slvler\PhoneValidation\Phone;

    Phone::getData('14152007986');

  • This was a successful request, so the valid phone number and details associated with it are returned below:
   {
    "phone": "14152007986",
    "valid": true,
    "format": {
        "international": "+14152007986",
        "local": "(415) 200-7986"
    },
    "country": {
        "code": "US",
        "name": "United States",
        "prefix": "+1"
    },
        "location": "California",
        "type": "mobile",
        "carrier": "T-Mobile USA, Inc."
    }

Testing

    composer test

Credits

License

The MIT License (MIT). Please see License File for more information.


  Classes of Hicri  >  Laravel Phone Validation  >  Download Download .zip .tar.gz  >  Support forum Support forum  >  Blog Blog  >  RSS 1.0 feed RSS 2.0 feed Latest changes  
Name: Laravel Phone Validation
Base name: phone-validation
Description: Laravel service to validate phone numbers
Version: -
PHP version: 5
License: The PHP License
 
  Groups   Applications   Files Files  

  Groups  
Group folder image PHP 5 Classes using PHP 5 specific features View top rated classes
Group folder image Web services Web data clipping, SOAP or XML-RPC clients and servers View top rated classes
Group folder image Validation Validation algorithms View top rated classes


  Applications that use this package  
No pages of applications that use this class were specified.

Add link image If you know an application of this package, send a message to the author to add a link here.

  Files folder image Files  
File Role Description
Files folder image.github (1 directory)
Files folder imageconfig (1 file)
Files folder imagesrc (2 files, 2 directories)
Files folder imagetests (2 directories)
Accessible without login Plain text file .styleci.yml Data Auxiliary data
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file phpunit.xml Data Auxiliary data
Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files  /  .github  
File Role Description
Files folder imageworkflows (1 file)

  Files folder image Files  /  .github  /  workflows  
File Role Description
  Accessible without login Plain text file tests.yml Data Auxiliary data

  Files folder image Files  /  config  
File Role Description
  Accessible without login Plain text file phone.php Aux. Auxiliary script

  Files folder image Files  /  src  
File Role Description
Files folder imageFacades (1 file)
Files folder imageHttp (3 files)
  Plain text file Phone.php Class Class source
  Plain text file PhoneValidationServiceProvider.php Class Class source

  Files folder image Files  /  src  /  Facades  
File Role Description
  Plain text file PhoneValidation.php Class Class source

  Files folder image Files  /  src  /  Http  
File Role Description
  Plain text file Build.php Class Class source
  Plain text file BuildAdapter.php Class Class source
  Plain text file HttpResponse.php Class Class source

  Files folder image Files  /  tests  
File Role Description
Files folder imageFeature (1 file)
Files folder imageUnit (1 file)

  Files folder image Files  /  tests  /  Feature  
File Role Description
  Plain text file PhoneTest.php Class Class source

  Files folder image Files  /  tests  /  Unit  
File Role Description
  Plain text file TestCase.php Class Class source

Download Download all files: phone-validation.tar.gz phone-validation.zip
NOTICE: if you are using a download manager program like 'GetRight', please Login before trying to download this archive.
  Files folder image Files  
File Role Description
Files folder image.github (1 directory)
Files folder imageconfig (1 file)
Files folder imagesrc (2 files, 2 directories)
Files folder imagetests (2 directories)
Accessible without login Plain text file .styleci.yml Data Auxiliary data
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file phpunit.xml Data Auxiliary data
Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files  /  .github  
File Role Description
Files folder imageworkflows (1 file)

  Files folder image Files  /  .github  /  workflows  
File Role Description
  Accessible without login Plain text file tests.yml Data Auxiliary data

  Files folder image Files  /  config  
File Role Description
  Accessible without login Plain text file phone.php Aux. Auxiliary script

  Files folder image Files  /  src  
File Role Description
Files folder imageFacades (1 file)
Files folder imageHttp (3 files)
  Plain text file Phone.php Class Class source
  Plain text file PhoneValidationServiceProvider.php Class Class source

  Files folder image Files  /  src  /  Facades  
File Role Description
  Plain text file PhoneValidation.php Class Class source

  Files folder image Files  /  src  /  Http  
File Role Description
  Plain text file Build.php Class Class source
  Plain text file BuildAdapter.php Class Class source
  Plain text file HttpResponse.php Class Class source

  Files folder image Files  /  tests  
File Role Description
Files folder imageFeature (1 file)
Files folder imageUnit (1 file)

  Files folder image Files  /  tests  /  Feature  
File Role Description
  Plain text file PhoneTest.php Class Class source

  Files folder image Files  /  tests  /  Unit  
File Role Description
  Plain text file TestCase.php Class Class source

Download Download all files: phone-validation.tar.gz phone-validation.zip
NOTICE: if you are using a download manager program like 'GetRight', please Login before trying to download this archive.