PHP Classes

Validate CPF and CNPJ Numbers: Validate CPF and CNPJ tax pay numbers in Brazil

Recommend this page to a friend!
  Info   Documentation   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 30 All time: 11,119 This week: 63Up
Version License PHP version Categories
cpfcnpj-validator 1.0MIT/X Consortium ...5PHP 5, Validation
Description 

Author

This package can validate CPF and CNPJ tax pay numbers in Brazil.

It provides the implementation of rules to validate tax payer numbers of Brazilian citizens and companies.

Application controllers need to pass a HTTP request object to the package so it can take the CPF or CNPJ values to verify if the values are correct.

Picture of Thiago Przyczynski
  Performance   Level  
Name: Thiago Przyczynski <contact>
Classes: 16 packages by
Country: Brazil Brazil
Age: 35
All time rank: 3194238 in Brazil Brazil
Week rank: 192 Up14 in Brazil Brazil Up
Innovation award
Innovation award
Nominee: 8x

Documentation

CPF/CNPJ Validator

A Laravel package to work with CNPJ validation.

CPF is an individual taxpayer identification number given to people living in Brazil, both native Brazilians and resident foreigners.

CNPJ is the National Registry of Legal Entities in Brazil.

Installation

` composer install thiagoprz/cpfcnpj-validator`

Usage

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;

class CnpjController extends Controller
{
    ...
    /
     * Store action
     */
    public function store(Request $request)
    {
        $this->validate($request, [
            'cnpj' => 'cpfcnpj', // CPF/CNPJ validation
            ...
        ]);
        ...
    }
    ...
}

  Files folder image Files (7)  
File Role Description
Files folder imagesrc (2 files, 1 directory)
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file README.md Doc. Read me

  Files folder image Files (7)  /  src  
File Role Description
Files folder imagelang (3 directories)
  Plain text file CpfCnpj.php Class Class source
  Plain text file CpfCnpjServiceProvider.php Class Class source

  Files folder image Files (7)  /  src  /  lang  
File Role Description
Files folder imageen (1 file)
Files folder imagept-BR (1 file)
Files folder imagept_BR (1 file)

  Files folder image Files (7)  /  src  /  lang  /  en  
File Role Description
  Accessible without login Plain text file validation.php Aux. Auxiliary script

  Files folder image Files (7)  /  src  /  lang  /  pt-BR  
File Role Description
  Accessible without login Plain text file validation.php Aux. Auxiliary script

  Files folder image Files (7)  /  src  /  lang  /  pt_BR  
File Role Description
  Accessible without login Plain text file validation.php Aux. Auxiliary script

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:30
This week:0
All time:11,119
This week:63Up