cancio-labs/cpf-symfony-validator

A custom Symfony Validator that validates CPF.

Maintainers

Package info

github.com/canciolabs/cpf-symfony-validator

pkg:composer/cancio-labs/cpf-symfony-validator

Statistics

Installs: 5

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

1.0.0 2024-07-25 02:41 UTC

This package is not auto-updated.

Last update: 2026-03-06 08:40:58 UTC


README

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(),
    ],
]);