PHP code example of arthurtavaresdev / cnpj-promise-php

1. Go to this page and download the library: Download arthurtavaresdev/cnpj-promise-php library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

arthurtavaresdev / cnpj-promise-php example snippets


use ArthurTavaresDev\CnpjPromise\CnpjPromise;

ise::fetch($cnpj);

/*
ArthurTavaresDev\CnpjPromise\Data\Company Object
(  
  +cnpj: "27865757000102"
  +legalName: "GLOBO COMUNICACAO E PARTICIPACOES S/A"
  +tradeName: "TV/REDE/CANAIS/G2C+GLOBO GLOBO.COM GLOBOPLAY"
  +incorporationDate: Carbon\CarbonImmutable,
  +mainCnae: "2054"
  +legalNature: "2054"
  +establishmentType: "DEMAIS"
  +revenue: 6983568523.86
  +isSimpleNational: false
)
*/

use ArthurTavaresDev\CnpjPromise\CnpjPromise;

ise::fetch($cnpj)->toArray();

/*
array:9 [
  "cnpj" => "27865757000102"
  "legalName" => "GLOBO COMUNICACAO E PARTICIPACOES S/A"
  "tradeName" => "TV/REDE/CANAIS/G2C+GLOBO GLOBO.COM GLOBOPLAY"
  "incorporationDate" => "1986-01-31"
  "mainCnae" => "2054"
  "legalNature" => "2054"
  "establishmentType" => "DEMAIS"
  "revenue" => 6983568523.86
  "isSimpleNational" => false
]
*/

use ArthurTavaresDev\CnpjPromise\CnpjPromise;

sse->promises('27865757000102');

composer