thiagoprz / cpf-validator
Laravel package to validate CPF (Brazilian taxpayer identification number)
Installs: 1 122
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: ^7.1.3
- illuminate/support: ^5.5 || ^6.0 || ^7.0 || ^8.0
Requires (Dev)
- orchestra/testbench: ^3.8
- phpunit/phpunit: ^8.3@dev
README
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
...
]);
...
}
...
}