PHPackages                             gabeta/lara-pnn - 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. gabeta/lara-pnn

ActiveLibrary

gabeta/lara-pnn
===============

1.0.7(5y ago)8181MITPHPPHP ^5.5|^5.6|^7.0|^7.1|^7.2|^7.3|^7.4

Since Jan 5Pushed 5y ago1 watchersCompare

[ Source](https://github.com/gabeta/lara-pnn)[ Packagist](https://packagist.org/packages/gabeta/lara-pnn)[ Docs](https://github.com/gabeta/lara-pnn)[ RSS](/packages/gabeta-lara-pnn/feed)WikiDiscussions main Synced yesterday

READMEChangelog (8)Dependencies (3)Versions (9)Used By (0)

[![Build Status](https://camo.githubusercontent.com/26950e93f94e75e7fbf33e022154cda435c86564c254c711eb988760554b4c17/68747470733a2f2f7472617669732d63692e6f72672f6761626574612f6c6172612d706e6e2e7376673f6272616e63683d6d61696e)](https://travis-ci.org/gabeta/lara-pnn)

Lara-pnn
========

[](#lara-pnn)

Lara-pnn is a laravel package which allows you to format your phone number in the new Ivorian format (change from 8 digits to 10 digits).

> **Note:**
>
> From January 31, 2021, Ivorian numbers will change to 10 digits, ARTCI has published a note to help with migration.
>
> This package will be useful for existing applications with an Ivorian number database. Ivory Coast Diald code is **+225**

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

[](#installation)

Require this package with composer.

```
composer require gabeta/lara-pnn
```

Laravel uses Package Auto-Discovery, so doesn't require you to manually add the ServiceProvider.

##### Laravel without auto-discovery:

[](#laravel-without-auto-discovery)

If you don't use auto-discovery, add the ServiceProvider to the providers array in config/app.php

```
Gabeta\LaraPnn\laraPnnServiceProvider::class
```

And add this to your facades in app.php:

```
'LaraPnn' => Gabeta\LaraPnn\Facades\LaraPnn::class,
```

The package was designed for the Ivorian case but if you have a similar case other than that of Côte d'Ivoire. This package handled it very well, you just have to publish and modify the package configuration file. See more options in `config/larapnn.php`

##### Copy the package config to your local config with the publish command:

[](#copy-the-package-config-to-your-local-config-with-the-publish-command)

```
php artisan vendor:publish --provider="Gabeta\LaraPnn\laraPnnServiceProvider"
```

Usage
-----

[](#usage)

#### Prepare your model

[](#prepare-your-model)

So that your models can format your Ivorian numbers, the model must implement the following interface and trait:

```
use Gabeta\LaraPnn\InteractWithLaraPnn;
use Gabeta\LaraPnn\LaraPnnAbstract;

class YourModel extends Model implements LaraPnnAbstract
{
    use InteractWithLaraPnn;
}
```

Then you must define the fields concerned by the migration.

```
use Gabeta\LaraPnn\InteractWithLaraPnn;
use Gabeta\LaraPnn\LaraPnnAbstract;

class YourModel extends Model implements LaraPnnAbstract
{
    use InteractWithLaraPnn;

    protected $pnnFields = [
        'mobile' => ['mobile_field_name'],
        'fix' => ['fix_field_name']
    ];
}
```

We check the eligibility of the number before migration based on the dial code if the dial code value is in another field you must define with attribute `$pnnDialCodeFields`:

```
use Gabeta\LaraPnn\InteractWithLaraPnn;
use Gabeta\LaraPnn\LaraPnnAbstract;

class YourModel extends Model implements LaraPnnAbstract
{
    use InteractWithLaraPnn;

    protected $pnnFields = [
        'mobile' => ['mobile_field_name'],
        'fix' => ['fix_field_name']
    ];

    protected $pnnDialCodeFields = [
        'mobile_field_name' => 'mobile_dial_code_field_name',
        'fix_field_name' => 'fix_dial_code_field_name'
    ];
}
```

#### Basic usage: Migrate without change database value

[](#basic-usage-migrate-without-change-database-value)

You can make a basic use of it which will migrate your numbers without modifying the values ​​in the database.

```
// Before use LaraPnn trait
$yourModel->mobile_field_name // 225 09 00 00 00
$yourModel->fix_field_name // 225 20 30 00 00

// After use LaraPnn trait
$yourModel->mobile_field_name // 225 07 09 00 00 00
$yourModel->fix_field_name // 225 27 20 30 00 00
```

#### Advanced usage: Database migration

[](#advanced-usage-database-migration)

For a migration of numbers in the database, the one-command package allows you to migrate all your numbers from a single mode.

```
php artisan larapnn:migrate YouModelNamepace\\YourModel
```

You also have a command that allows you to rollback

```
php artisan larapnn:rollback YouModelNamepace\\YourModel
```

You can add the take option to take records do you want:

```
php artisan larapnn:migrate YouModelNamepace\\YourModel --take=50000

php artisan larapnn:rollback YouModelNamepace\\YourModel  --take=50000
```

You can add the skip option to skip the stats part (used if you are using a schedule job):

```
php artisan larapnn:migrate YouModelNamepace\\YourModel --skip

php artisan larapnn:rollback YouModelNamepace\\YourModel --skip
```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 97.7% 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 ~7 days

Total

8

Last Release

1906d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/16475656?v=4)[Gabeta Soro](/maintainers/gabeta)[@gabeta](https://github.com/gabeta)

---

Top Contributors

[![gabeta](https://avatars.githubusercontent.com/u/16475656?v=4)](https://github.com/gabeta "gabeta (43 commits)")[![rg4amia](https://avatars.githubusercontent.com/u/17311182?v=4)](https://github.com/rg4amia "rg4amia (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/gabeta-lara-pnn/health.svg)

```
[![Health](https://phpackages.com/badges/gabeta-lara-pnn/health.svg)](https://phpackages.com/packages/gabeta-lara-pnn)
```

PHPackages © 2026

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