PHPackages                             andrey-helldar/beautiful-phone - 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. andrey-helldar/beautiful-phone

Abandoned → [propaganistas/laravel-phone](/?search=propaganistas%2Flaravel-phone)ArchivedLibrary[Utility &amp; Helpers](/categories/utility)

andrey-helldar/beautiful-phone
==============================

Formatting a phone number into a beautiful view

v2.2.0(5y ago)63.5k↓100%MITPHPPHP ^7.2

Since Apr 3Pushed 5y ago2 watchersCompare

[ Source](https://github.com/andrey-helldar/beautiful-phone)[ Packagist](https://packagist.org/packages/andrey-helldar/beautiful-phone)[ Fund](https://money.yandex.ru/to/410012115955701)[ Fund](https://paypal.me/helldar)[ RSS](/packages/andrey-helldar-beautiful-phone/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (10)Dependencies (3)Versions (18)Used By (0)

Beautiful Phone Formatter
=========================

[](#beautiful-phone-formatter)

Formatting a phone number into a beautiful view.

[![beautiful phone](https://user-images.githubusercontent.com/10347617/66074886-f3b82c80-e562-11e9-80b1-ba731deba9f3.png)](https://user-images.githubusercontent.com/10347617/66074886-f3b82c80-e562-11e9-80b1-ba731deba9f3.png)

> This package is abandoned and no longer maintained. The author suggests using the [propaganistas/laravel-phone](https://github.com/Propaganistas/Laravel-Phone) package instead.

 [![Total Downloads](https://camo.githubusercontent.com/43ad659afe91d155d43dd8159362670525f634559a3201a097a689096c562346/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f616e647265792d68656c6c6461722f62656175746966756c2d70686f6e652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/andrey-helldar/beautiful-phone) [![Latest Stable Version](https://camo.githubusercontent.com/0e0786295dbaa6b371ab89edf5b31b2dda2c07062b68ed5ab2d101270f1f7616/68747470733a2f2f706f7365722e707567782e6f72672f616e647265792d68656c6c6461722f62656175746966756c2d70686f6e652f762f737461626c653f666f726d61743d666c61742d737175617265)](https://packagist.org/packages/andrey-helldar/beautiful-phone) [![Latest Unstable Version](https://camo.githubusercontent.com/4688a0fe228f51c03fec94d100c77fbb4450f1e63abcb7d7a7c884b34bced318/68747470733a2f2f706f7365722e707567782e6f72672f616e647265792d68656c6c6461722f62656175746966756c2d70686f6e652f762f756e737461626c653f666f726d61743d666c61742d737175617265)](https://packagist.org/packages/andrey-helldar/beautiful-phone)

 [![StyleCI](https://camo.githubusercontent.com/8467e918a4929b0da3558a9f401e4a9a93d16f3ec19213e98e62b92a5f979a11/68747470733a2f2f7374796c6563692e696f2f7265706f732f3132373837393332322f736869656c64)](https://styleci.io/repos/127879322) [![Travis-CI](https://camo.githubusercontent.com/aa461cf8033507dc894084456e7b76207d69a45d52fb058cf7ae31ec2714f9d7/68747470733a2f2f7472617669732d63692e6f72672f616e647265792d68656c6c6461722f62656175746966756c2d70686f6e652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/andrey-helldar/beautiful-phone) [![License](https://camo.githubusercontent.com/58de7fce942ac51553aaf863752593f45f3c38382ed2395b3d8cf31809aacefe/68747470733a2f2f706f7365722e707567782e6f72672f616e647265792d68656c6c6461722f62656175746966756c2d70686f6e652f6c6963656e73653f666f726d61743d666c61742d737175617265)](LICENSE)

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

[](#installation)

To get the latest version of `Beautiful Phone Formatter`, simply require the project using [Composer](https://getcomposer.org):

```
composer require andrey-helldar/beautiful-phone

```

Instead, you may of course manually update your require block and run `composer update` if you so choose:

```
{
    "require": {
        "andrey-helldar/beautiful-phone": "^2.1"
    }
}
```

### Laravel

[](#laravel)

You can also publish the config file to change implementations (ie. interface to specific class):

```
php artisan vendor:publish --provider="Helldar\BeautifulPhone\ServiceProvider"
```

### Lumen

[](#lumen)

This package is focused on Laravel development, but it can also be used in Lumen with some workarounds. Because Lumen works a little different, as it is like a barebone version of Laravel and the main configuration parameters are instead located in `bootstrap/app.php`, some alterations must be made.

You can install the package in `app/Providers/AppServiceProvider.php`, and uncommenting this line that registers the App Service Providers so it can properly load.

```
// $app->register(App\Providers\AppServiceProvider::class);
```

If you are not using that line, that is usually handy to manage gracefully multiple Lumen installations, you will have to add this line of code under the `Register Service Providers `section of your `bootstrap/app.php`.

```
$app->register(\Helldar\BeautifulPhone\ServiceProvider::class);

```

Using
-----

[](#using)

Now you can use the universal `phone()` helper inside the Laravel Framework (`phone()` too working).

Or create a `Phone` instance:

```
use Helldar\BeautifulPhone\Services\Phone;

return (new Phone())->get(/*...params...*/);
```

### Default parameters:

[](#default-parameters)

```
return phone('4567');
// returned: 4567

return phone('fooba');
// returned: +7 (812) 3-66-22

return phone('foobar');
// returned: +7 (812) 36-62-27

return phone('123123');
// returned: +7 (812) 123-123

return phone('31234567890');
// returned: +3 (123) 456-789-0

return phone('+33216549883');
// returned: +3 (321) 654-98-83

return phone('+33216665557');
// returned: +3 (321) 666-555-7

return phone('+73216665557');
// returned: +7 (321) 666-555-7

return phone('+83216665557');
// returned: +7 (321) 666-555-7
```

### With manual applying city code:

[](#with-manual-applying-city-code)

```
return phone('4567', 1234);
// returned: 4567

return phone('fooba', 1234);
// returned: +7 (1234) 3-66-22

return phone('foobar', 1234);
// returned: +7 (1234) 36-62-27

return phone('123123', 1234);
// returned: +7 (1234) 123-123

return phone('31234567890', 1234);
// returned: +3 (1234) 567-890

return phone('+33216549883', 1234);
// returned: +3 (321) 654-98-83

return phone('+33216665557', 1234);
// returned: +3 (321) 666-555-7

return phone('+73216665557', 1234);
// returned: +7 (321) 666-555-7

return phone('+83216665557', 1234);
// returned: +7 (321) 666-555-7
```

### With disabled html formatting into phone number:

[](#with-disabled-html-formatting-into-phone-number)

```
return phone('4567', 0, false);
// returned: 4567

return phone('fooba', 0, false);
// returned: +7 (812) 3-66-22

return phone('foobar', 0, false);
// returned: +7 (812) 36-62-27

return phone('123123', 0, false);
// returned: +7 (812) 123-123

return phone('31234567890', 0, false);
// returned: +3 (123) 456-789-0

return phone('+33216549883', 0, false);
// returned: +3 (321) 654-98-83

return phone('+33216665557', 0, false);
// returned: +3 (321) 666-555-7

return phone('+73216665557', 0, false);
// returned: +7 (321) 666-555-7

return phone('+83216665557', 0, false);
// returned: +7 (321) 666-555-7
```

### With enabled html formatting and disabled `is_link` parameter into phone number:

[](#with-enabled-html-formatting-and-disabled-is_link-parameter-into-phone-number)

```
return phone('4567', 0, true, false);
// returned: 4567

return phone('fooba', 0, true, false);
// returned: +7 (812) 3-66-22

return phone('foobar', 0, true, false);
// returned: +7 (812) 36-62-27

return phone('123123', 0, true, false);
// returned: +7 (812) 123-123

return phone('31234567890', 0, true, false);
// returned: +3 (123) 456-789-0

return phone('+33216549883', 0, true, false);
// returned: +3 (321) 654-98-83

return phone('+33216665557', 0, true, false);
// returned: +3 (321) 666-555-7

return phone('+73216665557', 0, true, false);
// returned: +7 (321) 666-555-7

return phone('+83216665557', 0, true, false);
// returned: +7 (321) 666-555-7
```

### With disabled html formatting and `is_link` parameter into phone number:

[](#with-disabled-html-formatting-and-is_link-parameter-into-phone-number)

```
return phone('4567', 0, false, false);
// returned: 4567

return phone('fooba', 0, false, false);
// returned: +7 (812) 3-66-22

return phone('foobar', 0, false, false);
// returned: +7 (812) 36-62-27

return phone('123123', 0, false, false);
// returned: +7 (812) 123-123

return phone('31234567890', 0, false, false);
// returned: +3 (123) 456-789-0

return phone('+33216549883', 0, false, false);
// returned: +3 (321) 654-98-83

return phone('+33216665557', 0, false, false);
// returned: +3 (321) 666-555-7

return phone('+73216665557', 0, false, false);
// returned: +7 (321) 666-555-7

return phone('+83216665557', 0, false, false);
// returned: +7 (321) 666-555-7
```

### With full clear attribute:

[](#with-full-clear-attribute)

```
return phone('4567', 0, false, false, [], true);
// returned: 4567

return phone('fooba', 0, false, false, [], true);
// returned: +781236622

return phone('foobar', 0, false, false, [], true);
// returned: +7812366227

return phone('123123', 0, false, false, [], true);
// returned: +7812123123

return phone('31234567890', 0, false, false, [], true);
// returned: +31234567890

return phone('+33216549883', 0, false, false, [], true);
// returned: +33216549883

return phone('+33216665557', 0, false, false, [], true);
// returned: +33216665557

return phone('+73216665557', 0, false, false, [], true);
// returned: +73216665557

return phone('+83216665557', 0, false, false, [], true);
// returned: +73216665557
```

### With additional attributes:

[](#with-additional-attributes)

```
$attributes = ["id" => "foo", "class" => "bar baz", "data-value" => "foo"];

// Default parameters:
return phone('foobar', 0, true, true, $attributes);
// returned: +7 (812) 36-62-27

// With manual applying city code:
return phone('foobar', 1234, true, true, $attributes);
// returned: +7 (1234) 36-62-27

// With disabled html formatting into phone number:
return phone('foobar', 0, false, true, $attributes);
// returned: +7 (812) 36-62-27

// With enabled html formatting and disabled `is_link` parameter into phone number:
return phone('foobar', 0, true, false, $attributes);
// returned: +7 (812) 36-62-27

// With disabled html formatting and `is_link` parameter into phone number:
return phone('foobar', 0, false, false, $attributes);
// returned: +7 (812) 36-62-27
```

### Laravel/Lumen facade

[](#laravellumen-facade)

If you are using the Laravel or Lumen framework, then you can use the `Phone` facade call:

```
use Helldar\BeautifulPhone\Facades\Phone;

return Phone::spanLink('foobar');
// returned: +7 (812) 36-62-27

return Phone::cleanLink('foobar');
// returned: +7 (812) 36-62-27

return Phone::span('foobar');
// returned: +7 (812) 36-62-27

return Phone::clear('foobar');
// returned: +7 (812) 36-62-27

return Phone::fullClear('foobar');
// returned: +7812366227
```

Copyright and License
---------------------

[](#copyright-and-license)

`Beautiful Phone Formatter` was written by Andrey Helldar, and is released under the [MIT LICENSE](LICENSE).

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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 ~56 days

Total

17

Last Release

2062d ago

Major Versions

v1.6.2 → v2.0.02020-07-22

PHP version history (5 changes)1.0.0PHP ^5.6|^7.0

1.1.0PHP &gt;=5.6.4

v1.4.0PHP ^7.0

v1.6.0PHP ^7.1

v2.1.0PHP ^7.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/b77790e612f1c9beed1e1533e36eba4954fbd6da2a5c9f71e845cd0f5465f0ad?d=identicon)[Helldar](/maintainers/Helldar)

---

Top Contributors

[![andrey-helldar](https://avatars.githubusercontent.com/u/10347617?v=4)](https://github.com/andrey-helldar "andrey-helldar (1 commits)")

---

Tags

formatterphonebeautifulbeautiful-phone

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/andrey-helldar-beautiful-phone/health.svg)

```
[![Health](https://phpackages.com/badges/andrey-helldar-beautiful-phone/health.svg)](https://phpackages.com/packages/andrey-helldar-beautiful-phone)
```

###  Alternatives

[kartik-v/php-date-formatter

A Javascript datetime formatting and manipulation library using PHP date-time formats.

461.5M3](/packages/kartik-v-php-date-formatter)[shitoudev/phone-location

location of phone number

15890.4k](/packages/shitoudev-phone-location)[hallindavid/manny

a package of manipulators that hopefully come in useful for those of us who always forget regex when we need it (manny is short for manipulation)

38103.3k2](/packages/hallindavid-manny)[rynpsc/craft-phone-number

International phone number field.

2265.9k](/packages/rynpsc-craft-phone-number)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

255.2k](/packages/aedart-athenaeum)[mihaeu/html-formatter

HTML Formatter pritifies HTML content by applying proper intendation (no tidy, purification, etc.).

1770.8k4](/packages/mihaeu-html-formatter)

PHPackages © 2026

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