PHPackages                             aquinoaldair/phone-code - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. aquinoaldair/phone-code

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

aquinoaldair/phone-code
=======================

Códigos de teléfonos o marcación por país en laravel

1.4(6y ago)1014MITPHPPHP ^7.1.3

Since Apr 22Pushed 6y ago1 watchersCompare

[ Source](https://github.com/aquinoaldair/phone-code)[ Packagist](https://packagist.org/packages/aquinoaldair/phone-code)[ Docs](https://github.com/aquinoaldair/phone-code)[ RSS](/packages/aquinoaldair-phone-code/feed)WikiDiscussions master Synced 4d ago

READMEChangelogDependencies (3)Versions (5)Used By (0)

Codigos o Prefijos de teléfonos de paises
=========================================

[](#codigos-o-prefijos-de-teléfonos-de-paises)

[![Latest Version on Packagist](https://camo.githubusercontent.com/07010140ab531fae2f53dbf73f3097a805c0a78d695928ad0548e69716871c54/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f617175696e6f616c646169722f70686f6e652d636f64652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/aquinoaldair/phone-code)[![Build Status](https://camo.githubusercontent.com/a6fbdbff428be5a3791467e19b1ca5481e7ea3f982db473890945817add5526a/68747470733a2f2f7472617669732d63692e6f72672f617175696e6f616c646169722f70686f6e652d636f64652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/aquinoaldair/phone-code)[![Total Downloads](https://camo.githubusercontent.com/e51384523276aaac66804eb5ab77ace20c5d9d11a9dd3062b009cbf53192f82f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f617175696e6f616c646169722f70686f6e652d636f64652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/aquinoaldair/phone-code)

Laravel 5.8 or higher, 6.x, 7.x

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require aquinoaldair/phone-code
```

Usage
-----

[](#usage)

Properties:

nombre, name, phone\_code, iso2, iso3

```
use Aquinoaldair\PhoneCode\PhoneCode;

//PRINCIPAL FUNCTIONS

$phonecode = new PhoneCode();

$phonecode->make("2281694545")->fromName('Mexico'); // return "522281694545"
$phonecode->makeFull("2281694545")->fromName('Mexico'); // return "+522281694545"

$phonecode->make("2281694545")->fromIso2('MX'); // return "522281694545"
$phonecode->makeFull("2281694545")->fromIso2('MX'); // return "+522281694545"

$phonecode->make("2281694545")->fromIso3('MEX'); // return "522281694545"
$phonecode->makeFull("2281694545")->fromIso3('mex'); // return "+522281694545"

$phonecode->getAll(); // return all data as collection

//STATICS FUNCTIONS

PhoneCode::isCodeOf(51);   // "Peru"
PhoneCode::codeOf("Peru"); // "51"
$items = PhoneCode::get(); // return a collection

// Working with collections

$item  = $items->first();

$item->phone_code; // "93
$item->nombre; // "Afganistán"
$item->name; // "Afghanistan"
$item->iso2; // "AF"
$item->iso3; // "AFG"

$items->firstWhere('name', "Peru");

/*
{
  "nombre": "Perú"
  "name": "Peru"
  "nom": "Pérou"
  "iso2": "PE"
  "iso3": "PER"
  "phone_code": "51"
}
*/

- You can implement any functionality of the laravel collections.
- See https://laravel.com/docs/7.x/collections
```

Configuration
-------------

[](#configuration)

```
php artisan vendor:publish --tag=config

```

This will publish all the configuration options to: config/phone-code.php. You can add new values.

### Testing

[](#testing)

```
composer test
```

### Changelog

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

### Security

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Aldair](https://github.com/aquinoaldair)
-

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

Laravel Package Boilerplate
---------------------------

[](#laravel-package-boilerplate)

This package was generated using the [Laravel Package Boilerplate](https://laravelpackageboilerplate.com).

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

4

Last Release

2213d ago

PHP version history (2 changes)1.0PHP ^7.1

1.4PHP ^7.1.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/004144adf14982da9b119b271eff4012375cc86abbb51a92b8e6675779613965?d=identicon)[aquinoaldair](/maintainers/aquinoaldair)

---

Tags

codecountrieslaravelphonephonecodephpprefixphplaravelPhone codeaquinoaldairdial-codeprefijos-telefono

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/aquinoaldair-phone-code/health.svg)

```
[![Health](https://phpackages.com/badges/aquinoaldair-phone-code/health.svg)](https://phpackages.com/packages/aquinoaldair-phone-code)
```

###  Alternatives

[stevebauman/location

Retrieve a user's location by their IP Address

1.3k7.6M65](/packages/stevebauman-location)[monicahq/laravel-cloudflare

Add Cloudflare ip addresses to trusted proxies for Laravel.

3372.7M4](/packages/monicahq-laravel-cloudflare)[mediconesystems/livewire-datatables

Advanced datatables using Laravel, Livewire, Tailwind CSS and Alpine JS

1.2k711.3k8](/packages/mediconesystems-livewire-datatables)[kra8/laravel-snowflake

Snowflake for Laravel and Lumen.

188402.3k6](/packages/kra8-laravel-snowflake)[bezhansalleh/filament-google-analytics

Google Analytics integration for FilamentPHP

205144.8k5](/packages/bezhansalleh-filament-google-analytics)[laragear/preload

Effortlessly make a Preload script for your Laravel application.

119363.5k](/packages/laragear-preload)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
