PHPackages                             hallindavid/phonehelper - 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. hallindavid/phonehelper

Abandoned → [hallindavid/manny](/?search=hallindavid%2Fmanny)ArchivedLibrary

hallindavid/phonehelper
=======================

A super easy to use phone number formatter for Laravel. Note - Only works on north american phone numbers

810[2 PRs](https://github.com/hallindavid/PhoneHelper/pulls)PHP

Since Mar 28Pushed 3y ago1 watchersCompare

[ Source](https://github.com/hallindavid/PhoneHelper)[ Packagist](https://packagist.org/packages/hallindavid/phonehelper)[ RSS](/packages/hallindavid-phonehelper/feed)WikiDiscussions master Synced 6d ago

READMEChangelogDependenciesVersions (4)Used By (0)

[![hallindavid](https://camo.githubusercontent.com/0e80e1f2c50385400ad9a1d5f699b3f3d473cbfaf8fd6b50756e283175f7a557/68747470733a2f2f636972636c6563692e636f6d2f67682f68616c6c696e64617669642f50686f6e6548656c7065722e7376673f7374796c653d737667)](https://camo.githubusercontent.com/0e80e1f2c50385400ad9a1d5f699b3f3d473cbfaf8fd6b50756e283175f7a557/68747470733a2f2f636972636c6563692e636f6d2f67682f68616c6c696e64617669642f50686f6e6548656c7065722e7376673f7374796c653d737667)

PhoneHelper
===========

[](#phonehelper)

A super easy to use phone number formatter for Laravel. Note - Only works on north american phone numbers.

[![](demo-phonehelper.gif)](demo-phonehelper.gif)

Getting Started / Installation
------------------------------

[](#getting-started--installation)

```
composer require hallindavid/phonehelper
```

Laravel should autodiscover the Provider &amp; Alias.

You should now be able to use the PhoneHelper alias to format phone numbers.

eg:

```
PhoneHelper::format('12345678912');
// defult result: 234-567-8912
```

Usage
-----

[](#usage)

For basic usage, you can use the alias `PhoneHelper` and the format function

```
use PhoneHelper;

class TestController extends Controller
{
    public function index()
    {
        $newPhone = PhoneHelper::format('12345678912');
    }
}
```

Using Different Formats
-----------------------

[](#using-different-formats)

By default the PhoneHelper comes with these formats

FormatOutput (with 8888888888888) entered10888888888810-dash (default)888-888-888810-brack(888) 888-888810-brack-ext(888) 888-8888 ext. 88810-dot888.888.8888111888888888811-dash1-888-888-888811-brack1 (888) 888-888811-dot1.888.888.8888+11-brack+1 (888) 888-8888E.164 (useful for Twilio and other apis)+18888888888I've also started working on extensions, but am just shy of finishing that quite yet. It'll be out shortly.

Creating/Modifying Formats
--------------------------

[](#creatingmodifying-formats)

You can publish the configuration

```
php artisan vendor:publish --provider="Hallindavid\PhoneHelper\PhoneHelperServiceProvider"
```

This will create the configuration file: `config/phonehelper.php`

From here you are able to add/remove/edit formats and there are lots of comments which can help you do that.

This image identifies the difference pieces of the phone number formatter. [![](formatting-phones.png)](formatting-phones.png)

And here is a sample format

```
'my-custom-format'=> [
    'parts'=>['country','area','exchange','line','extension'],
    'delimiters'=>[
        'prefix'=> '+',
        'country_area'=> ' (',
        'area_exchange'=> ') ',
        'exchange_line'=>'-',
        'line_extension'=>' ext. ',
    ]
],
```

After setting this up - you could execute this

```
PhoneHelper::format('8888888888888', 'my-custom-format');
// +1 (888) 888-8888 ext. 888
```

Testing
-------

[](#testing)

There are a tonne of tests for the packaged formats - to run them, pull the package then

```
composer install
composer test
```

Support
-------

[](#support)

To say thanks, you can share the project on social media or

[![Buy Me A Coffee](https://camo.githubusercontent.com/9f44ce2dc3b3eecdd02598900866ffc518801df1932849703dae1e5ce5031070/68747470733a2f2f7777772e6275796d6561636f666665652e636f6d2f6173736574732f696d672f637573746f6d5f696d616765732f6f72616e67655f696d672e706e67)](https://www.buymeacoffee.com/tDbQ4kg)

Issues
------

[](#issues)

Please report all issues in the GitHub Issue tracker

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

[](#contributing)

Shoot me an email, or DM me on twitter and I am happy to allow other contributors.

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

 Bus Factor1

Top contributor holds 63.3% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/94662fba8d9e407e1edae89161dd8894bb389fa5d74403688023bdc3866d37fd?d=identicon)[hallindavid](/maintainers/hallindavid)

---

Top Contributors

[![hallindavid](https://avatars.githubusercontent.com/u/53200282?v=4)](https://github.com/hallindavid "hallindavid (19 commits)")[![ordago](https://avatars.githubusercontent.com/u/6376814?v=4)](https://github.com/ordago "ordago (8 commits)")[![amayer5125](https://avatars.githubusercontent.com/u/3212673?v=4)](https://github.com/amayer5125 "amayer5125 (3 commits)")

### Embed Badge

![Health badge](/badges/hallindavid-phonehelper/health.svg)

```
[![Health](https://phpackages.com/badges/hallindavid-phonehelper/health.svg)](https://phpackages.com/packages/hallindavid-phonehelper)
```

PHPackages © 2026

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