Skip to content

A awesome set of PHP validation classes.

License

Notifications You must be signed in to change notification settings

vesperabr/validation

Repository files navigation

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.

About

A awesome set of PHP validation classes.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages