Skip to content

Laravel package to validate CPF (Brazilian taxpayer identification number)

Notifications You must be signed in to change notification settings

thiagoprz/cpf-validator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CPF Validator

A Laravel package to work with CPF validation.

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

Installation

composer install thiagoprz/cpf-validator

Usage

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;

class CpfController extends Controller
{
    ...
    /**
     * Store action
     */
    public function store(Request $request)
    {
        $this->validate($request, [
            'cpf' => 'cpf', // CPF validation
            'cpf2' => 'cpf:true', // CPF validation allowing empty value
            ...
        ]);
        ...
    }
    ...
}

About

Laravel package to validate CPF (Brazilian taxpayer identification number)

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages