PHP Classes

File: README.md

Recommend this page to a friend!
  Classes of Thiago Przyczynski   Validate CPF and CNPJ Numbers   README.md   Download  
File: README.md
Role: Documentation
Content type: text/markdown
Description: Read me
Class: Validate CPF and CNPJ Numbers
Validate CPF and CNPJ tax pay numbers in Brazil
Author: By
Last change:
Date: 3 years ago
Size: 710 bytes
 

Contents

Class file image Download

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
            ...
        ]);
        ...
    }
    ...
}