charlottedunois / validator
PHP Validator for stuff.
Installs: 35 111
Dependents: 1
Suggesters: 0
Security: 0
Stars: 9
Watchers: 2
Forks: 3
Open Issues: 0
Requires
- php: >=7.0
Requires (Dev)
README
This is a PHP validator for stuff.
Usage
Include composer's autoloader and initialize an instance.
<?php // include autoloader //This one will not fail $nofail = CharlotteDunois\Validation\Validator::make( array( 'username' => 'CharlotteDunois', 'email' => 'noreply@github.com' ), array( 'username' => 'string|required|min:5|max:75', 'email' => 'email' ) ); var_dump($nofail->passes()); //This one will fail due to invalid email $fail = CharlotteDunois\Validation\Validator::make( array( 'username' => 'CharlotteDuois', 'email' => 'noreply@githubcom' ), array( 'username' => 'string|required|min:5|max:75', 'email' => 'email' ) ); var_dump($fail->passes(), $fail->errors());