| Package Data | |
|---|---|
| Maintainer Username: | douglasresendemaciel |
| Maintainer Contact: | eu@douglasresende.com (Douglas Resende Maciel) |
| Package Create Date: | 2017-03-28 |
| Package Last Update: | 2025-05-05 |
| Home Page: | |
| Language: | PHP |
| License: | MIT |
| Last Refreshed: | 2025-12-14 03:00:30 |
| Package Statistics | |
|---|---|
| Total Downloads: | 4,165 |
| Monthly Downloads: | 127 |
| Daily Downloads: | 0 |
| Total Stars: | 4 |
| Total Watchers: | 1 |
| Total Forks: | 2 |
| Total Open Issues: | 0 |
This library validate CPF, CNPJ and CNH numbers
Run the following command from you terminal:
composer require "douglasresendemaciel/brazilian-documents-validator:@dev"
or add this to require section in your composer.json file:
"douglasresendemaciel/brazilian-documents-validator"
then run composer update
Once it is installed, you need to register the service provider. Open up config/app.php and add the following to the providers key.
'providers' => [
...
DouglasResende\BrazilianDocumentsValidator\BrazilianDocumentsProvider::class
...
$this->validate($request, [
'cnpj' => 'required|cnpj',
]);
$this->validate($request, [
'cpf' => 'required|cpf',
]);
$this->validate($request, [
'cnh' => 'required|cnh',
]);
OR you can use on RequestValidator files like this:
'rules' => [
...
'cpf' => 'required|cpf',
...
Douglas Resende: http://www.douglasresende.com/
For more information read the official documentation at https://laravel.com/docs/5.4/