jailtonsc / validador-cnpj-laravel
Validador de cnpj com suporte para laravel 5.*
Installs: 2 842
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 2
Forks: 1
Open Issues: 0
Requires
- php: >=5.5.9
This package is auto-updated.
Last update: 2024-11-11 03:51:31 UTC
README
Validador de cnpj com suporte para laravel 5.*
Composer Instalação
composer require jailtonsc/validador-cnpj-laravel
Integração com o Laravel
No arquivo config/app.php
em providers coloque
ValidadorCnpj\CnpjServiceProvider::class
publish
php artisan vendor:publish
Modo de usar exemplo
namespace App\Http\Requests; use App\Http\Requests\Request; class ArquivoRequest 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 [ 'cnpj' => 'cnpj' ]; } }
ou
$this->validate($request, [ 'cnpj' => 'cnpj', ]);