Skip to content

Latest commit

 

History

History
39 lines (26 loc) · 628 Bytes

README.md

File metadata and controls

39 lines (26 loc) · 628 Bytes

php-validation

A php package for validation.

Installation

Install via composer

composer require atakde/php-validation

Usage

require 'vendor/autoload.php';

use Atakde\PhpValidation\Validator;

$params = [
    'username' => 'TestUsername',
    'email' => '[email protected]',
    'password' => '123'
];

$validateRules = [
    'email' => 'required|email',
    'username' => 'required|string|min:5|max:10',
    'password' => 'required|password'
];

$validator = new Validator();
$validator->validate($validateRules, $params);

var_dump($validator->fails());
var_dump($validator->getErrors());