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.
- Host: GitHub
- URL: https://github.com/canciolabs/cpf-symfony-validator
- Owner: canciolabs
- License: gpl-3.0
- Created: 2024-07-25T02:19:44.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-07-25T02:44:51.000Z (9 months ago)
- Last Synced: 2025-02-01T02:51:13.306Z (3 months ago)
- Topics: cpf, cpf-validador, php, symfony-validator
- Language: PHP
- Homepage:
- Size: 21.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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(),
],
]);