Package Data | |
---|---|
Maintainer Username: | douglasresendemaciel |
Maintainer Contact: | eu@douglasresende.com (Douglas Resende Maciel) |
Package Create Date: | 2017-03-28 |
Package Last Update: | 2024-10-10 |
Home Page: | |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2025-02-09 15:00:22 |
Package Statistics | |
---|---|
Total Downloads: | 3,222 |
Monthly Downloads: | 157 |
Daily Downloads: | 0 |
Total Stars: | 4 |
Total Watchers: | 2 |
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/