stonkeep/cpf-cnpj
Validate, format, and generate Brazilian CPF and CNPJ documents in Laravel. Includes ready-to-use validation rules, mask and formatting helpers, and clean value objects so you can handle tax IDs consistently across your application.
cpf_cnpj column with a unique/format constraint.Consider it when:
composer require.Look elsewhere (or vendor the logic) when:
Rule object instead.To executives: "A free add-on for our internal admin panel that stops invalid Brazilian tax IDs from being saved — small, contained, and cheap. It's a convenience, not a strategic dependency: no adoption base, one maintainer. I recommend we pilot it in the admin only, or spend half a day copying the validation logic in-house so we own it. Either way it doesn't touch the customer experience or our roadmap."
To engineering: "One Nova field, drop-in, does masking plus check-digit validation. Caveats: unmaintained and unaudited — zero stars, zero dependents. Pin the version, read the source, add tests around the field, and confirm it handles the alphanumeric CNPJ format before we commit to it. If it's less than a day to extract the validation rule into our own app/Rules directory, prefer that."
How can I help you explore Laravel packages today?