An open API service indexing awesome lists of open source software.

https://github.com/canciolabs/cpf-symfony-validator

A custom Symfony Validator that validates CPF.
https://github.com/canciolabs/cpf-symfony-validator

cpf cpf-validador php symfony-validator

Last synced: about 1 month ago
JSON representation

A custom Symfony Validator that validates CPF.

Awesome Lists containing this project

README

        

# CPF Symfony Validator

A custom Symfony Validator that validates CPF.

## Requirements

- PHP >= 7.4

## Installation

composer require cancio-labs/cpf-symfony-validator

## How to use it

Add the CpfConstraint in your entity...

use CancioLabs\Validator\Cpf\CpfConstraint;

#[CpfConstraint]
private ?Cpf $cpf = null;

or add it to a constraint list:

use CancioLabs\Validator\Cpf\CpfConstraint;

$formBuilder->add('cpf', TextType::class, [
'constraints' => [
new CpfConstraint(),
],
]);