PHPackages                             dominik-eller/laravel-data-normalizer - 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. [Validation &amp; Sanitization](/categories/validation)
4. /
5. dominik-eller/laravel-data-normalizer

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

dominik-eller/laravel-data-normalizer
=====================================

A Laravel package to normalize and format data such as phone numbers, emails, and other input into standardized formats.

v1.3.0(1mo ago)0515↓66.7%MITPHPPHP ^8.3CI passing

Since Sep 25Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/dominik-eller/laravel-data-normalizer)[ Packagist](https://packagist.org/packages/dominik-eller/laravel-data-normalizer)[ Docs](https://github.com/dominik-eller/laravel-data-normalizer)[ GitHub Sponsors](https://github.com/dominik-eller)[ RSS](/packages/dominik-eller-laravel-data-normalizer/feed)WikiDiscussions main Synced yesterday

READMEChangelog (6)Dependencies (28)Versions (12)Used By (0)

A Laravel package to normalize and format data such as phone numbers, emails, and other input into standardized formats.
========================================================================================================================

[](#a-laravel-package-to-normalize-and-format-data-such-as-phone-numbers-emails-and-other-input-into-standardized-formats)

[![Latest Version on Packagist](https://camo.githubusercontent.com/2f8e6823f6106b4cee9b3789f1ddecebbad65fbf8462d2acbc9f7573338da8df/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f646f6d696e696b2d656c6c65722f6c61726176656c2d646174612d6e6f726d616c697a65722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/dominik-eller/laravel-data-normalizer)[![GitHub Tests Action Status](https://camo.githubusercontent.com/b57db28c1e6ff28424b1536b5759fecd60bfeece694102c95ff831fa9f9198bb/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f646f6d696e696b2d656c6c65722f6c61726176656c2d646174612d6e6f726d616c697a65722f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/dominik-eller/laravel-data-normalizer/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/d4c58736806cb3960611582bcdf915a4b7339da26f970ab70471a8de64fa5157/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f646f6d696e696b2d656c6c65722f6c61726176656c2d646174612d6e6f726d616c697a65722f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/dominik-eller/laravel-data-normalizer/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/609c8e0913e90a9f36f2b3afd3da8f95cd97aa38186856e427c0093517ff6f18/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f646f6d696e696b2d656c6c65722f6c61726176656c2d646174612d6e6f726d616c697a65722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/dominik-eller/laravel-data-normalizer)

A Laravel package to normalize and format data such as phone numbers, emails, and other input into standardized formats.

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

[](#installation)

You can install the package via composer:

```
composer require dominik-eller/laravel-data-normalizer
composer dump-autoload
```

You can publish the config file with:

```
php artisan vendor:publish --tag="data-normalizer-config"
```

This is the contents of the published config file:

```
return [
    'phone' => [
        'default_country' => 'DE',
        'format' => 'E164',
    ],
    'email' => [
        'trim_whitespace' => true,
        'lowercase' => true,
    ],
];
```

Usage
-----

[](#usage)

### Normalize a phone number

[](#normalize-a-phone-number)

```
use Deller\DataNormalizer\Facades\DataNormalizer;

$normalizedPhone = DataNormalizer::create('phone')->normalize('+49 (151) 123 45678');
// $normalizedPhone will be "+4915112345678" (E.164 format)
```

### Format a phone number

[](#format-a-phone-number)

```
use Deller\DataNormalizer\Facades\DataFormatter;

$formattedPhone = DataFormatter::create('phone')->format('+4915112345678', ['format' => 'INTERNATIONAL']);
// $formattedPhone will be "+49 151 1234 5678"
```

If parsing fails, the formatter logs the error and returns the original value.

### Normalize an email address

[](#normalize-an-email-address)

```
use Deller\DataNormalizer\Facades\DataNormalizer;

$normalizedEmail = DataNormalizer::create('email')->normalize('  JohnDoe@Example.com  ');
// $normalizedEmail will be "johndoe@example.com"
```

### Format an email address

[](#format-an-email-address)

```
use Deller\DataNormalizer\Facades\DataFormatter;

$formattedEmail = DataFormatter::create('email')->format('  JohnDoe@Example.com  ');
// $formattedEmail will be "johndoe@example.com"
```

### Registering a custom formatter

[](#registering-a-custom-formatter)

```
use Deller\DataNormalizer\Factories\DataFormatterFactory;

class CustomFormatter extends \Deller\DataNormalizer\DataFormatter
{
    public function format($data)
    {
        return 'Formatted: ' . strtoupper($data);
    }
}

// Register the custom formatter type
DataFormatterFactory::registerType('custom', CustomFormatter::class);

// Use the custom formatter via the facade
$customFormatter = \Deller\DataNormalizer\Facades\DataFormatter::create('custom');
echo $customFormatter->format('some data'); // Output: "Formatted: SOME DATA"
```

### Registering a custom normalizer

[](#registering-a-custom-normalizer)

```
use Deller\DataNormalizer\Factories\DataNormalizerFactory;

class CustomNormalizer extends \Deller\DataNormalizer\DataNormalizer
{
    public function normalize($data)
    {
        return 'Normalized: ' . strtolower(trim($data));
    }
}

// Register the custom normalizer type
DataNormalizerFactory::registerType('custom', CustomNormalizer::class);

// Use the custom normalizer via the facade
$customNormalizer = \Deller\DataNormalizer\Facades\DataNormalizer::create('custom');
echo $customNormalizer->normalize('  SOME DATA  '); // Output: "Normalized: some data"
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

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

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

[](#contributing)

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

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please report security vulnerabilities by email to  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Dominik Eller](https://github.com/dominik-eller)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

46

—

FairBetter than 92% of packages

Maintenance88

Actively maintained with recent releases

Popularity15

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

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

Recently: every ~146 days

Total

6

Last Release

59d ago

PHP version history (2 changes)v1.0.0PHP ^8.2

v1.3.0PHP ^8.3

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/12881106?v=4)[Dominik Eller](/maintainers/dominik-eller)[@dominik-eller](https://github.com/dominik-eller)

---

Top Contributors

[![dominik-eller](https://avatars.githubusercontent.com/u/12881106?v=4)](https://github.com/dominik-eller "dominik-eller (49 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (11 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (5 commits)")

---

Tags

laravelDominik Ellerlaravel-data-normalizer

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/dominik-eller-laravel-data-normalizer/health.svg)

```
[![Health](https://phpackages.com/badges/dominik-eller-laravel-data-normalizer/health.svg)](https://phpackages.com/packages/dominik-eller-laravel-data-normalizer)
```

###  Alternatives

[spatie/laravel-permission

Permission handling for Laravel 12 and up

12.9k102.4M1.4k](/packages/spatie-laravel-permission)[spatie/laravel-pdf

Create PDFs in Laravel apps

1.0k4.8M47](/packages/spatie-laravel-pdf)[dedoc/scramble

Automatic generation of API documentation for Laravel applications.

2.1k11.2M100](/packages/dedoc-scramble)[defstudio/telegraph

A laravel facade to interact with Telegram Bots

816333.8k3](/packages/defstudio-telegraph)[spatie/laravel-passkeys

Use passkeys in your Laravel app

471890.7k39](/packages/spatie-laravel-passkeys)[rawilk/profile-filament-plugin

Profile &amp; MFA starter kit for filament.

3914.6k](/packages/rawilk-profile-filament-plugin)

PHPackages © 2026

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