PHPackages                             datalogix/laravel-validation - 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. datalogix/laravel-validation

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

datalogix/laravel-validation
============================

Laravel Validation is a package the power of Respect Validation.

v3.1.0(1mo ago)37.1k—10%1MITPHPPHP ^8.2CI passing

Since Oct 18Pushed 12mo ago1 watchersCompare

[ Source](https://github.com/datalogix/laravel-validation)[ Packagist](https://packagist.org/packages/datalogix/laravel-validation)[ Docs](https://github.com/datalogix/laravel-validation)[ GitHub Sponsors](https://github.com/ricardogobbosouza)[ Fund](https://opencollective.com/ricardogobbosouza)[ RSS](/packages/datalogix-laravel-validation/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (10)Versions (12)Used By (1)

Laravel Validation
==================

[](#laravel-validation)

[![Latest Stable Version](https://camo.githubusercontent.com/f329e8ccd7b85076ac1348f01414d42eec1b00827ee0f1b6c8c9f6d12f8a05b0/68747470733a2f2f706f7365722e707567782e6f72672f646174616c6f6769782f6c61726176656c2d76616c69646174696f6e2f76657273696f6e)](https://packagist.org/packages/datalogix/laravel-validation)[![Total Downloads](https://camo.githubusercontent.com/e5f658be6db6e86919da21fe90c944a009ce144175ad7ed96831b1f46d119014/68747470733a2f2f706f7365722e707567782e6f72672f646174616c6f6769782f6c61726176656c2d76616c69646174696f6e2f646f776e6c6f616473)](https://packagist.org/packages/datalogix/laravel-validation)[![tests](https://github.com/datalogix/laravel-validation/workflows/tests/badge.svg)](https://github.com/datalogix/laravel-validation/actions)[![StyleCI](https://camo.githubusercontent.com/9b6b9b29b06f4dad19819251c5866eca666c64f4d30582e1b3808d61328e7613/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3431383634373737352f736869656c643f7374796c653d666c6174)](https://github.styleci.io/repos/418647775)[![codecov](https://camo.githubusercontent.com/070a80daf7c0f2d3e42f51f8b23e9e5e26c4e92a589daffa765b641b911f1e87/68747470733a2f2f636f6465636f762e696f2f67682f646174616c6f6769782f6c61726176656c2d76616c69646174696f6e2f6272616e63682f6d61696e2f67726170682f62616467652e737667)](https://codecov.io/gh/datalogix/laravel-validation)[![License](https://camo.githubusercontent.com/5c9d857653872ed6f958851f1e529c850fcbed34f2a50df7d657c099ca9a64ca/68747470733a2f2f706f7365722e707567782e6f72672f646174616c6f6769782f6c61726176656c2d76616c69646174696f6e2f6c6963656e7365)](https://packagist.org/packages/datalogix/laravel-validation)

> Laravel Validation is a package the power of [Respect Validation](https://respect-validation.readthedocs.io).

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

[](#installation)

You can install the package via composer:

```
composer require datalogix/laravel-validation
```

The package will automatically register itself.

Usage
-----

[](#usage)

```
$rules = [
    'cpf'               => ['cpf'],
    'cnpj'              => ['cnpj'],
    'cnh'               => ['cnh'],
    'minimumAge'        => ['minimumAge:20'],
    'callback'          => ['callback:is_int'],
    'charset'           => ['charset:ASCII'],
    'consonant'         => ['consonant'],
    'vowel'             => ['vowel'],
    'alnum'             => ['alnum:-'],
    'digit'             => ['digit: '],
    'alpha'             => ['alpha'],
    'containsArray'     => ['contains:banana'],
    'contains'          => ['contains:banana'],
    'countryCode'       => ['countryCode'],
    'creditCard'        => ['digit', 'creditCard'],
    'domain'            => ['domain'],
    'directory'         => ['directory'],
    'fileExists'        => ['fileExists'],
    'isFile'            => ['file'],
    'endsWith'          => ['endsWith:banana'],
    'equals'            => ['equals:banana'],
    'even'              => ['even'],
    'floatVal'          => ['floatVal'],
    'float'             => ['floatVal'],
    'graph'             => ['graph'],
    'instance'          => ['instance:DateTime'],
    'int'               => ['int'],
    'json'              => ['json'],
    'leapDate'          => ['leapDate:Y-m-d'],
    'leapYear'          => ['leapYear'],
    'arrayVal'          => ['arrayVal'],
    'Arr'               => ['arrayVal'],
    'lowercase'         => ['lowercase'],
    'macAddress'        => ['macAddress'],
    'multiple'          => ['multiple:3'],
    'negative'          => ['negative'],
    'noWhitespace'      => ['noWhitespace'],
    'nullValue'         => ['nullValue'],
    'numeric'           => ['numeric'],
    'objectType'        => ['objectType'],
    'odd'               => ['odd'],
    'perfectSquare'     => ['perfectSquare'],
    'positive'          => ['positive'],
    'primeNumber'       => ['primeNumber'],
    'punct'             => ['punct'],
    'readable'          => ['readable'],
    'regex'             => ['regex:/5/'],
    'roman'             => ['roman'],
    'slug'              => ['slug'],
    'space'             => ['space:b'],
    'tld'               => ['tld'],
    'uppercase'         => ['uppercase'],
    'version'           => ['version'],
    'xdigit'            => ['xdigit'],
    'writable'          => ['writable'],
    'alwaysValid'       => ['alwaysValid'],
    'boolType'          => ['boolType'],
    'youtube'           => ['videoUrl:youtube'],
    'vimeo'             => ['videoUrl:vimeo'],
    'video1'            => ['videoUrl'],
    'video2'            => ['videoUrl'],
    'email'             => ['email:rfc,dns'],
    'age'               => ['minAge:18', 'maxAge:60'],
    'state'             => ['subdivisionCode:BR'],
];

$data = [
    'cpf'               => '22205417118',
    'cnpj'              => '68518321000116',
    'cnh'               => '02650306461',
    'minimumAge'        => '1990-11-13',
    'callback'          => 20,
    'charset'           => 'acucar',
    'consonant'         => 'dcfg',
    'vowel'             => 'aeiou',
    'alnum'             => 'banana-123',
    'digit'             => '120129 21212',
    'alpha'             => 'banana',
    'containsArray'     => ['www', 'banana', 'jfk', 'http'],
    'contains'          => 'www banana jfk http',
    'countryCode'       => 'BR',
    'creditCard'        => '5555666677778884',
    'domain'            => 'google.com.br',
    'directory'         => __DIR__,
    'fileExists'        => __FILE__,
    'file'              => __FILE__,
    'endsWith'          => 'pera banana',
    'equals'            => 'banana',
    'even'              => 8,
    'floatVal'          => 9.8,
    'graph'             => 'LKM@#$%4;',
    'instance'          => new \Datetime(),
    'int'               => 9,
    'json'              => '{"file":"laravel.php"}',
    'leapDate'          => '1988-02-29',
    'leapYear'          => '1988',
    'arrayVal'          => ['Brazil'],
    'lowercase'         => 'brazil',
    'macAddress'        => '00:11:22:33:44:55',
    'multiple'          => '9',
    'negative'          => '-10',
    'noWhitespace'      => 'laravelBrazil',
    'nullValue'         => null,
    'numeric'           => '179.9',
    'objectType'        => new \stdClass(),
    'odd'               => 3,
    'perfectSquare'     => 25,
    'positive'          => 1,
    'primeNumber'       => 7,
    'punct'             => '&,.;[]',
    'readable'          => __FILE__,
    'regex'             => '5',
    'roman'             => 'VI',
    'slug'              => 'laravel-brazil',
    'space'             => '              b      ',
    'tld'               => 'com',
    'uppercase'         => 'BRAZIL',
    'version'           => '1.0.0',
    'xdigit'            => 'abc123',
    'writable'          => __FILE__,
    'alwaysValid'       => '@#$_',
    'boolType'          => \is_int(2),
    'youtube'           => 'http://youtu.be/l2gLWaGatFA',
    'vimeo'             => 'http://vimeo.com/33677985',
    'video1'            => 'https://youtu.be/l2gLWaGatFA',
    'video2'            => 'https://vimeo.com/33677985',
    'email'             => 'foo@google.com',
    'age'               => '1990-11-13',
    'state'             => 'SP',
];

$validator = \Illuminate\Validation\Validator::make($data, $rules);

if ($validator->passes()) {
    // Do something
}
```

For more validation rules
=========================

[](#for-more-validation-rules)

See all available rules here:

Repository of Respect Validation:

###  Health Score

47

—

FairBetter than 94% of packages

Maintenance67

Regular maintenance activity

Popularity26

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

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

Recently: every ~174 days

Total

11

Last Release

55d ago

Major Versions

v1.3.0 → v2.0.02023-06-12

v2.2.0 → v3.0.02025-04-14

PHP version history (3 changes)v1.0.0PHP ^7.3|^8.0

v2.0.0PHP ^7.4|^8.0

v3.0.0PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/64f33efa07f410c2b5e41054fcf2bd13369172846b9fd71420d2162e90bb6a1a?d=identicon)[ricardogobbosouza](/maintainers/ricardogobbosouza)

---

Top Contributors

[![ricardogobbosouza](https://avatars.githubusercontent.com/u/13064722?v=4)](https://github.com/ricardogobbosouza "ricardogobbosouza (44 commits)")

---

Tags

laravelvalidationrespectrules

###  Code Quality

TestsPHPUnit

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/datalogix-laravel-validation/health.svg)

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

###  Alternatives

[proengsoft/laravel-jsvalidation

Validate forms transparently with Javascript reusing your Laravel Validation Rules, Messages, and FormRequest

1.1k2.3M49](/packages/proengsoft-laravel-jsvalidation)[axlon/laravel-postal-code-validation

Worldwide postal code validation for Laravel and Lumen

3853.3M1](/packages/axlon-laravel-postal-code-validation)[laravel-validation-rules/credit-card

Validate credit card number, expiration date, cvc

2412.2M5](/packages/laravel-validation-rules-credit-card)[resultsystems/validation

Inspired 'KennedyTedesco Validation' - The power of 'Respect Validation' on Laravel.

2832.4k4](/packages/resultsystems-validation)[illuminatech/validation-composite

Allows uniting several validation rules into a single one for easy re-usage

184485.5k](/packages/illuminatech-validation-composite)[galahad/laravel-addressing

Laravel package providing addressing functionality

70316.6k](/packages/galahad-laravel-addressing)

PHPackages © 2026

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