Package Data | |
---|---|
Maintainer Username: | wartent |
Maintainer Contact: | elton.inacio95@gmail.com (Elton Inacio) |
Package Create Date: | 2016-09-19 |
Package Last Update: | 2016-09-19 |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2025-02-09 15:09:53 |
Package Statistics | |
---|---|
Total Downloads: | 25 |
Monthly Downloads: | 0 |
Daily Downloads: | 0 |
Total Stars: | 0 |
Total Watchers: | 1 |
Total Forks: | 0 |
Total Open Issues: | 0 |
Validação de cpf, cnpj, cpfcnpj para laravel 5.*
$ composer require eltoninacio/cpfcnpj-laravel
ou
"require": {
"eltoninacio/cpfcnpj-laravel": "1.0.*"
}
$ composer update
Registre o ServiceProvider no array providers
dentro do arquivo config/app.php
:
'providers' => [
// ...
EltonInacio\ValidadorCpjCnpj\CpfCnpjServiceProvider::class
]
$this->validade($request, [
'cpf' => 'cpf',
'cnpj' => 'cnpj',
'cpfcnpj' => 'cpfcnpj'
])
ou
namespace App\Http\Requests;
use App\Http\Requests\Request;
class CpfCnpjRequest extends Request {
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'cpf' => 'cpf',
'cnpj' => 'cnpj',
'cpfcnpj' => 'cpfcnpj'
];
}
}