gitmyhub

Validation

PHP ★ 6.0k updated 14h ago

The most awesome validation engine ever created for PHP

Respect/Validation is a PHP library with 150+ built-in rules for checking user input, letting you chain conditions like must be a positive number between 1 and 255 in a single readable line of code.

PHPComposerPackagistsetup: easycomplexity 2/5

Respect/Validation is a PHP library that handles input validation, meaning it checks whether data coming into your application meets the rules you have set. If you are building a website or API in PHP and need to verify that a submitted number is within a certain range, or that an email address looks correct, this library does that work for you.

The library is designed so that you can chain multiple rules together in a single readable line. For example, you can check that something is a number, that it is positive, and that it falls between 1 and 255, all in one statement. This makes the code easier to read than writing separate if-checks for each condition.

It ships with more than 150 built-in validators covering common needs like checking data types, string formats, numeric ranges, and more. Each validator is fully tested by the project team. It also includes tools for handling the error messages that come back when validation fails, so you can give users clear feedback about what went wrong.

The project is open source under the MIT license and is distributed through Packagist, which is the standard package registry for PHP projects. It is marked as a standalone component, meaning it can be added to an existing PHP project without requiring a particular framework. Documentation is hosted separately and covers the full list of available validators along with guides on contributing to the project.

Where it fits