New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

dominik-eller/laravel-data-normalizer

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

Larablocks Analysis

dominik-eller/laravel-data-normalizer works with Laravel 12 and 13 (latest release v1.3.0, May 6, 2026).

Laravel 10 and 11 in earlier releases.

Promising: maintained and up to date, meets 2 of 4 checks; not yet widely used.

  • Works with Laravel 13, the current version
  • Released in the last 12 months (May 6, 2026)
  • 416 downloads a month (needs 10,000)
  • 0 GitHub stars (needs 100)

State

Maintained
  • Last stable release: May 6, 2026.
  • 1 release in the last 12 months.
  • First released: Sep 25, 2024.
  • Monthly downloads: 416.
  • 1 open issue on GitHub.

Data from Packagist and GitHub, checked by Larablocks on Nov 29, 2026.

Install
composer require dominik-eller/laravel-data-normalizer
Latest Version:v1.3.0
PHP:^8.3
Laravel:12 · 13
Older releases:10 · 11
License:MIT
Last Updated:Jun 22, 2026
Links: GitHub  ·  Packagist
Maintainer: dominik-eller

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

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

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

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

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

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

use Deller\DataNormalizer\Facades\DataNormalizer;

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

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

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

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

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please report security vulnerabilities by email to me@dominik-eller.de instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

Related Packages

dominik-eller/laravel-qr-code

Generate QR Codes

1,396 0
doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

670,032,257 9,703
laravel/framework

The Laravel Framework.

640,572,096 35,338
laravel/tinker

Powerful REPL for the Laravel framework.

546,909,908 7,440
laravel/serializable-closure

Laravel Serializable Closure provides an easy and secure way to serialize closur...

465,816,364 607

Version History

Version Released PHP Laravel License
v1.3.0 ^8.3 ^12.0|^13.0 MIT
v1.2.1 ^8.2 ^11.0|^12.0 MIT
v1.2.0 ^8.2 ^11.0|^12.0 MIT
v1.1.1 ^8.2 ^11.0 MIT
v1.1.0 ^8.2 ^11.0 MIT