PHPackages                             ericc70/validation-utils - 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. [Mail &amp; Notifications](/categories/mail)
4. /
5. ericc70/validation-utils

ActiveLibrary[Mail &amp; Notifications](/categories/mail)

ericc70/validation-utils
========================

A package that gathers various validation utilities

1.0.0(2y ago)18MITPHP

Since Jun 8Pushed 2y ago1 watchersCompare

[ Source](https://github.com/ericc70/ValidationUtils)[ Packagist](https://packagist.org/packages/ericc70/validation-utils)[ RSS](/packages/ericc70-validation-utils/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)

ValidationUtils
===============

[](#validationutils)

A package that gathers various validation utilities.

---

Table of Contents
-----------------

[](#table-of-contents)

- [Installation](#installation)
- [EmailValidator](#emailvalidator)
- [StringValidator](#stringvalidator)
- [PhoneValidator](#phonevalidator)
- PasswordValidator

---

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

[](#installation)

Run the following command to install via Composer:

```
composer require ericc70/validation-utils
```

---

Getting started
---------------

[](#getting-started)

```
// Simple usage
use Ericc70\ValidationUtils\Lib\EmailValidator;
use Ericc70\ValidationUtils\Lib\StringValidator;
use Ericc70\ValidationUtils\Lib\PasswordValidator;
use Ericc70\ValidationUtils\Lib\PhoneValidator;

$validator = new EmailValidator();
$validator->validate('mail@domain.com');

$validator = new StringValidator();
$validator->validate('Hello World');

$validator = new PasswordValidator;
$validator->validate('As56*§cd3+heH*5s-5qs5d');

$validator = new PhoneValidator();
$validator->validate("+330304050607");

// Usage with options
$options = [
    'minLength' => 5,
    'maxLength' => 10,
    'regex' => '/^[a-zA-Z0-9]+$/',
    'required' => true,
];
$validator->validate('example', $options);
```

---

EmailValidator
--------------

[](#emailvalidator)

A utility for validating email addresses.

Available options:

OptionDescriptionDefault ValuebanDomainIndicates whether specific email domains are banned (e.g., disposable emails)falsevalidDomainIndicates whether the email domain must be valid (DNS verification)true---

PasswordValidator
-----------------

[](#passwordvalidator)

A utility for validating passwords.

Available options:

OptionDescriptionDefault ValueminLengthMinimum password length10maxLengthMaximum password length255minSpecialCharactersMinimum number of required special characters in the password1minNumericCharactersMinimum number of required numeric characters in the password1minAlphaCharactersMinimum number of required alphabetic characters in the password1minLowerCaseCharactersMinimum number of required lowercase characters in the password1minUpperCaseCharactersMinimum number of required uppercase characters in the password1maxRepeatedCharactersMaximum allowed number of repeated characters in the password3forbiddenPasswordIndicates whether specific common passwords are forbidden (e.g., a list)true---

StringValidator
---------------

[](#stringvalidator)

A utility for validating strings.

Available options:

OptionDescriptionDefault ValueminLengthMinimum required length for the string1maxLengthMaximum allowed length for the string255regexRegular expression or use `RegexCollection::getRegex('regexName')`""requiredIndicates whether the string is required or notfalse---

PhoneValidator
--------------

[](#phonevalidator)

A utility for validating phone numbers.

Dependency: @libphonenumber

OptionDescriptionDefault ValuemobileIndicates whether the phone number must be a mobile numberfalsefixedIndicates whether the phone number must be a landline numberfalseformatE164Indicates whether the phone number must be in E.164 format (e.g., +33612345678)falserestrictedCountriesList of restricted countries for phone number validation\[\]allowedCountriesList of allowed countries for phone number validation\[\]forbiddenNumberIndicates whether specific phone numbers are forbiddenfalsecurrentCountryCountry code (to check if the number belongs to the country)''specialCharactersIndicates whether special characters are allowed in the phone numberfalse---

Utilities
---------

[](#utilities)

### RegexCollection::Class

[](#regexcollectionclass)

A class that contains reusable regular expressions.

#### Available regexes:

[](#available-regexes)

RegexDescriptionalphaNumericValidates an alphanumeric stringemailValidates an email addressurlValidates a URLUse the `getRegex` method of the `RegexCollection` class to get the corresponding regular expression.

Example usage:

```
use Ericc70\ValidationUtils\Class\RegexCollection;

$regex = RegexCollection::getRegex('email');
```

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

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

Unknown

Total

1

Last Release

1075d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6b286c1658cc64b05eef872fa142d60a4350a813236e92edd438fcc60f9993cd?d=identicon)[ericc70](/maintainers/ericc70)

---

Tags

phpvalidatorvalidatorvalidationstringemailpasswordphone

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ericc70-validation-utils/health.svg)

```
[![Health](https://phpackages.com/badges/ericc70-validation-utils/health.svg)](https://phpackages.com/packages/ericc70-validation-utils)
```

###  Alternatives

[egulias/email-validator

A library for validating emails against several RFCs

11.6k691.3M307](/packages/egulias-email-validator)[kartik-v/yii2-validators

Enhanced Yii2 model validator components / utilities for Yii2 Framework

21137.9k](/packages/kartik-v-yii2-validators)[erag/laravel-disposable-email

A Laravel package to detect and block disposable email addresses.

226102.4k](/packages/erag-laravel-disposable-email)[kouz/laravel-mailgun-email-validation

Laravel email validation that uses the Mailgun API for a three-step validation check.

11141.0k1](/packages/kouz-laravel-mailgun-email-validation)

PHPackages © 2026

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