slvler/phone-validation 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

slvler/phone-validation

最新稳定版本:v2.0.1

Composer 安装命令:

composer require slvler/phone-validation

包简介

Phone Validation API for app.abstractapi.com

README 文档

README

tests Latest Stable Version License Total Downloads

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.

Requirements

  • PHP 8.1
  • Laravel 9.x | 10.x | 11.x

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
  • First of all we'll add the API key and API Url of the service we're using to our .env file of our project. If you don't have an account yet on app.abstractapi.com, you should create one. Once you have an account you can copy your API key from the dashboard page and put it into you .env file.
ABSTRACT_BASE_URL=https:https://phonevalidation.abstractapi.com
ABSTRACT_API_KEY=YOUR-API-KEY
  • 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.

Contributing

You're very welcome to contribute. Please see CONTRIBUTING for details.

统计信息

  • 总下载量: 44
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 28
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 28
  • Watchers: 1
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-01-26