Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/atakde/php-validation
- Owner: atakde
- Created: 2022-03-23T19:05:30.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2022-04-02T08:25:42.000Z (almost 3 years ago)
- Last Synced: 2024-12-08T13:04:01.690Z (about 1 month ago)
- Topics: form-valdiation, php, php-form, php-validation, php-validator, validate, validation, validator
- Language: PHP
- Homepage:
- Size: 23.4 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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());```