Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/atakde/php-validation

A php package for validation.
https://github.com/atakde/php-validation

form-valdiation php php-form php-validation php-validator validate validation validator

Last synced: 22 days ago
JSON representation

A php package for validation.

Awesome Lists containing this project

README

        

# php-validation

A php package for validation.

## Installation

Install via composer

```bash
composer require atakde/php-validation
```

## Usage

```php

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());

```