vesperabr / validation
A awesome set of PHP validation classes.
1.0.0
2021-09-13 14:09 UTC
Requires
- php: ^7.3|^8.0
- illuminate/support: ^7.0|^8.0
Requires (Dev)
- orchestra/testbench: ^6.20
- phpunit/phpunit: ^9.4.4
This package is auto-updated.
Last update: 2025-03-13 21:28:24 UTC
README
The vesperabr/validation
package provides an easy whay to validate input data.
It could be used in pure PHP or in Laravel projects.
Installation
You can install the package via composer:
$ composer require vesperabr/validation
The package will automatically register itself in Laravel.
How to use in Laravel
All you need to do is append the rule to your rules list.
public function store(Request $request) { $validated = $request->validate([ 'cpf' => 'required|cpf', ]); }
Available rules
- cnpj
- cpf
- cpf_ou_cnpj
- uf
How to use in PHP
use Vespera\Validation\Cpf; $validation = Cpf::make('111.111.111-11')->validate();
Avaiable classes
Vespera\Validation\Cnpj
Vespera\Validation\Cpf
Vespera\Validation\CpfOuCnpj
Vespera\Validation\Uf
Testing
$ composer test
Contributing
Please see CONTRIBUTING for details.
Credits
License
The MIT License (MIT). Please see License File for more information.