ekok / php-validation
PHP Validation
v0.1.4
2022-04-14 04:31 UTC
Requires
- php: >=8.0
- ekok/php-utils: ^0.2
Requires (Dev)
- codeception/codeception: ~4.1
- codeception/module-asserts: ^1.0.0
- codeception/module-phpbrowser: ^1.0.0
README
PHP Validation.
Usage
<?php use Ekok\Validation\Validator; $validator = new Validator(); $data = array( 'username' => 'foo', 'password' => 'bar', ); $rules = array( 'username' => 'trim|min:5', 'password' => 'trim|min:5', ); // any validation error will throw Ekok\Validation\ValidationException $result = $validator->validate($rules, $data); // $result['username'] is ok // $result['password'] is ok