Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
slvler committed Oct 19, 2024
1 parent c9a40c0 commit 98f7127
Showing 1 changed file with 21 additions and 23 deletions.
44 changes: 21 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# slvler - Phone Validation

[![tests](https://github.com/slvler/phone-validation/actions/workflows/tests.yml/badge.svg)](https://github.com/slvler/phone-validation/actions/workflows/tests.yml)
[![Latest Stable Version](http://poser.pugx.org/slvler/phone-validation/v)](https://packagist.org/packages/slvler/phone-validation)
[![Latest Unstable Version](http://poser.pugx.org/slvler/phone-validation/v/unstable)](https://packagist.org/packages/slvler/phone-validation)
[![License](http://poser.pugx.org/slvler/phone-validation/license)](https://packagist.org/packages/slvler/phone-validation)
[![Total Downloads](http://poser.pugx.org/slvler/phone-validation/downloads)](https://packagist.org/packages/slvler/phone-validation)
[![Latest Stable Version](https://poser.pugx.org/slvler/phone-validation/v)](https://packagist.org/packages/slvler/phone-validation)
[![Latest Unstable Version](https://poser.pugx.org/slvler/phone-validation/v/unstable)](https://packagist.org/packages/slvler/phone-validation)
[![License](https://poser.pugx.org/slvler/phone-validation/license)](https://packagist.org/packages/slvler/phone-validation)
[![Total Downloads](https://poser.pugx.org/slvler/phone-validation/downloads)](https://packagist.org/packages/slvler/phone-validation)

Phone Validation API for app.abstractapi.com

Expand All @@ -20,65 +20,63 @@ Validating and verifying phone numbers is a critical step to reducing the chance
To install this package tou can use composer:

```bash
composer require slvler/phone-validation
composer require slvler/phone-validation
```
## Usage

- First, you should extract the config/phone.php file to the config folder.

```php
php artisan vendor:publish --tag=phone
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.


```php
ABSTRACT_BASE_URL=https://phonevalidation.abstractapi.com
ABSTRACT_API_KEY=YOUR-API-KEY
ABSTRACT_BASE_URL=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:

```php
use slvler\PhoneValidation\Phone;
use slvler\PhoneValidation\Phone;

Phone::getData('14152007986');
Phone::getData('14152007986');
```

- This was a successful request, so the valid phone number and details associated with it are returned below:

```json
{
{
"phone": "14152007986",
"valid": true,
"format": {
"format":
{
"international": "+14152007986",
"local": "(415) 200-7986"
},
"country": {
"country":
{
"code": "US",
"name": "United States",
"prefix": "+1"
},
"location": "California",
"type": "mobile",
"carrier": "T-Mobile USA, Inc."
}
"location": "California",
"type": "mobile",
"carrier": "T-Mobile USA, Inc."
}
```


### Testing

```bash
composer test
composer test
```

## Credits

- [slvler](https://github.com/slvler)

- [slvler](https://github.com/slvler)

## License

Expand Down

0 comments on commit 98f7127

Please sign in to comment.