This library allow you get CPF and CNPJ from Receita Federal do Brasil.
Run the following command from you terminal:
composer require "douglasresendemaciel/receita-federal:@dev"
or add this to require section in your composer.json file:
"douglasresendemaciel/receita-federal"
then run composer update
Once it is installed, you need to register the service provider. Open up config/app.php and add the following to the providers key.
'providers' => [
...
DouglasResende\ReceitaFederal\ReceitaFederalServiceProvider::class
...
For captcha route, selected the 'TYPE' of document = 'CPF' or 'CNPJ'
...
CAPTCHA ROUTE => route( 'receita-federal.captcha', ['document' => TYPE ] )
PROCESS ROUTE CNPJ => route( 'receita-federal.processCNPJ', ['cnpj' => number, 'captcha' => value ] )
PROCESS ROUTE CPF => route( 'receita-federal.processCPF', ['cpf' => number, 'captcha' => value, 'birthday' => 'd/m/Y' ] )
...
To show the captcha image, use img tag like <img src="{{ route( 'receita-federal.captcha', ['document' => TYPE ] ) }}" alt="captcha">
then post the form to be processed at the routes of PROCESS ROUTES
Douglas Resende: http://www.douglasresende.com/
Marcos Peli: (http://www.facebook.com/pelimarcos)
Code based on https://github.com/Massa191/Consultas_CNPJ_CPF_Receita_Federal For more information read the official documentation at https://laravel.com/docs/5.4/