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

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

ixudra/validation
=================

Custom Laravel validation library - developer by Ixudra

1.3.0(4y ago)22.5k↓100%MITPHPPHP &gt;=5.4.0

Since May 31Pushed 4y ago1 watchersCompare

[ Source](https://github.com/ixudra/Validation)[ Packagist](https://packagist.org/packages/ixudra/validation)[ Docs](http://ixudra.be)[ RSS](/packages/ixudra-validation/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (3)Versions (12)Used By (0)

ixudra/validation
=================

[](#ixudravalidation)

[![Latest Version on Packagist](https://camo.githubusercontent.com/d22bf7e5bccd2760e1e5ad059ce1d0798eac12947aea47efa35a0fdaa7c6ce04/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6978756472612f76616c69646174696f6e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ixudra/validation)![license](https://camo.githubusercontent.com/258418af9edb0b732856b7dd8411b7bd7a8bc21e31a830febe8b5b9a2515aacf/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6978756472612f76616c69646174696f6e2e737667)[![StyleCI](https://camo.githubusercontent.com/85e83606d5364f6af997fd94cac7c5ee0916de641d4d72debb56cb5d8e89bff3/68747470733a2f2f7374796c6563692e696f2f7265706f732f31383439303135342f736869656c64)](https://styleci.io/repos/18490154)[![Total Downloads](https://camo.githubusercontent.com/abcd55048854c7b4da5084fc4d06b6cf3b96db4d822f97003c410a864bd01c2c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6978756472612f76616c69646174696f6e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ixudra/validation)

Custom PHP validation library - developed by [Ixudra](http://ixudra.be).

This package provides a wide variety of validation rules for PHP web applications. These rules can be used to easily validate user input to make sure that it meets the requirements that you have set.

Please also note that this package is intended for, but not exclusive to the Laravel framework. This basically means that most validation methods are universally usable in any PHP application but some make use of internal Laravel components (e.g. see `UserValidationTrait`). These methods will probably not work correctly unless you also include the used dependencies in you application as well.

This package can be used by anyone at any given time, but keep in mind that it is optimized for my personal custom workflow. It may not suit your project perfectly and modifications may be in order.

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

[](#installation)

Pull this package in through Composer.

```
{

    "require": {
        "ixudra/validation": "1.*"
    }

}
```

Laravel usage
-------------

[](#laravel-usage)

To use this package with Laravel 4 or 5, you will have to extend the default validator class. Once this class is created, you can include the traits into the class to make use of the validation methods. Laravel will automatically pick up the validation rules and make them available to you. Note that you don't have to include all traits if you don't want to. All validation rules are completely independent, which allows for maximum customization.

```
    use Ixudra\Validation\DateValidationTrait;
    use Ixudra\Validation\TimeValidationTrait;
    use Ixudra\Validation\ArrayValidationTrait;
    use Ixudra\Validation\PasswordValidationTrait;
    use Ixudra\Validation\CoordinateValidationTrait;

    class CustomValidator extends \Illuminate\Validation\Validator {

        use DateValidationTrait;
        use TimeValidationTrait;
        use ArrayValidationTrait;
        use PasswordValidationTrait;
        use CoordinateValidationTrait;

    }
```

Next, you will need to add the following to your `routes.php` to let Laravel know that you want to use your custom validator class instead of the default one:

```
    Validator::resolver(function($translator, $data, $rules, $messages)
    {
        return new CustomValidator($translator, $data, $rules, $messages);
    });
```

Once this is done, you are all set to go. You can now include the custom validation rules in the same way you use the default rules that Laravel already provides to you:

```
    $attributes = array(
        'att1'              => 'john.doe@gmail.com',
        'att2'              => 0,
        'att3'              => date('Y-m-d', strtotime('next week'))
    );

    $rules = array(
        'att1'              => 'required|email',
        'att2'              => 'required|truthy',
        'att3'              => 'required|future'
    );

    $validator = Validator::make( $attributes, $rules );
    $validator->fails();
```

Available validation methods
----------------------------

[](#available-validation-methods)

### Array Validation

[](#array-validation)

- **array\_size**: validates the size of an array
- **one\_or\_more\_selected**: returns `true` if an array contains an entry where the value is `true`

### Date Validation

[](#date-validation)

- **past**: returns `true` if the value contains a date which is set in the past
- **future**: returns `true` if the value contains a date which is set in the future (not including today)
- **less\_than\_three\_days\_old**: returns `true` if the value contains a date which is set less that three days in the past
- **today\_or\_later**: returns `true` if the value contains a date which is set in the future (including today)

### File Validation

[](#file-validation)

- **unique\_file\_name**: returns `true` if the value a unique file name. This function expects the full path name of the file starting from the Laravel `public/` directory

### JSON Validation

[](#json-validation)

- **json**: returns `true` is the value contains a valid JSON string

### Number Validation

[](#number-validation)

- **positive**: returns `true` is the value larger than 0
- **negative**: returns `true` if the value is smaller than 0

### Password Validation

[](#password-validation)

- **valid\_password**: returns `true` is the value contains a valid password (at least 6 characters long, at least one lowercase letter, at least one uppercase letter and at least one number)
- **correct\_password**: returns `true` if the value contains the correct password for the authenticated user (does not try to re-authenticate the user)

### String Validation

[](#string-validation)

- **empty**: returns `true` if the value contains an empty string

### Telephone Validation

[](#telephone-validation)

- **telephone\_number**: returns `true` if the value contains a valid (Belgian) telephone number

### Time Validation

[](#time-validation)

- **time**: returns `true` if the value contains a valid timestamp
- **time\_format**: returns `true` if the value contains a timestamp with the specified format

### Truthy Validation

[](#truthy-validation)

- **truthy**: returns `true` if the value is either `true` of `false`
- **true**: returns `true` if the value is `true`

### User Validation

[](#user-validation)

- **email\_belongs\_to\_authenticated\_user**: returns `true` if the value contains an email address which belongs to the authenticated user
- **id\_belongs\_to\_authenticated\_user**: returns `true` if the value contains an ID which belongs to the authenticated user

Have fun!

###  Health Score

33

—

LowBetter than 74% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity65

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 ~305 days

Recently: every ~661 days

Total

10

Last Release

1611d ago

Major Versions

0.1.4 → 1.0.02014-09-11

PHP version history (2 changes)0.1.1PHP &gt;=5.3.0

1.0.0PHP &gt;=5.4.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/c441bf73a59ca680bb804e22e746002a07d1a44542e8c417a45317bc79b224d8?d=identicon)[Elimentz](/maintainers/Elimentz)

---

Top Contributors

[![elimentz](https://avatars.githubusercontent.com/u/1410811?v=4)](https://github.com/elimentz "elimentz (23 commits)")

---

Tags

laravelvalidationIxudra

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[propaganistas/laravel-phone

Adds phone number functionality to Laravel based on Google's libphonenumber API.

3.0k35.7M106](/packages/propaganistas-laravel-phone)[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)[wendelladriel/laravel-validated-dto

Data Transfer Objects with validation for Laravel applications

759569.4k13](/packages/wendelladriel-laravel-validated-dto)[laravel-validation-rules/credit-card

Validate credit card number, expiration date, cvc

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

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

184485.5k](/packages/illuminatech-validation-composite)

PHPackages © 2026

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