rcngo / cpfcnpj
Cpf or Cnpj Functions
Installs: 7
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/rcngo/cpfcnpj
Requires
- php: 7.* || 8.*
- illuminate/support: 7.*
Requires (Dev)
- orchestra/testbench: ~v5.4.0
- phpunit/phpunit: 9.2.*
README
Installation / Configuration
Navigate to your project folder, for example:
cd /etc/www/projeto
And then run:
composer require rcngo/cpfcnpj:1.0.* --no-scripts
Or add it to the composer.json file, add it to your "require" :, example:
{
"require": {
"rcngo/cpfcnpj": "1.0.*"
}
}
Run the composer update --no-scripts command.
Use
cnpfcnpj::removeMaskCpfOrCnpj('000.000.000-00'); // return cpf string 00000000000 cnpfcnpj::removeMaskCpfOrCnpj('00.000.000/0000-00'); // return cnpj string 00000000000000 cnpfcnpj::maskCpfOrCnpj('00000000000'); // return cpf string 000.000.000-00 cnpfcnpj::maskCpfOrCnpj('00000000000000'); // return cnpj string 00.000.000/0000-00 cnpfcnpj::cpfValidate('000.000.000-00'); // return true or false cnpfcnpj::cnpjValidate('00.000.000/0000-00'); // return true or false