ark / validator
Form validator
v0.1.2
2016-02-04 12:49 UTC
This package is auto-updated.
Last update: 2024-11-13 23:18:56 UTC
README
PHP validator borrowed from Lavarel.
Installation
composer require ark/validator
Usage
<?php
use Ark\Validator\Validator;
$validator = new Validator($form, [
'email' => 'required|email',
'password' => 'required|length_between:8,20'
]);
if (!$validator->valid()) {
echo $validator->errors()->first();
} else {
echo 'success';
}