shoyim / php-validation
php requests validation helper functions
Installs: 4
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:project
Requires
- php: ^8.1
This package is auto-updated.
Last update: 2024-11-16 11:19:29 UTC
README
A php package for validation.
Installation
Install via composer
composer require shoyim/php-validation
Usage
require 'vendor/autoload.php'; use Shoyim\PhpValidation\Validator; $params = [ 'username' => 'shoyimobloqulov', 'email' => 'admin@gmail.com', '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());