PHP code example of rocheleedenis / laravel-notazz

1. Go to this page and download the library: Download rocheleedenis/laravel-notazz 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/ */

    

rocheleedenis / laravel-notazz example snippets


$notaFiscal = app(NotaFiscalBuilder::class);
$notaFiscal
    ->nfe()
    ->apiKey('b5b8f576a8075442d75be165b0447ace')
    ->destination()
        ->name('Beatriz Isabelly Mendes')
        ->taxid('01708781390')
        ->taxtype('F')
        ->street('Rua João Soares Lima')
        ->number('S/N')
        ->district('Centro')
        ->city('Águas Belas')
        ->uf('CE')
        ->zipcode('63887-973')
        ->email('[email protected]')
        ->phone('(88) 2592-2647')
    ->document()
        ->basevalue(70.30)
        ->description('Venda')
    ->products()
        ->add()
            ->cod(123)
            ->name('Escova de dente Cepacol')
            ->qtd(2)
            ->unitaryValue(15.20)
        ->save()
        ->add()
            ->cod(124)
            ->name('Pano de prato para cozinha')
            ->qtd(1)
            ->unitaryValue(55.10)
        ->save();

$notaFiscal = new \RocheleEdenis\LaravelNotazz\Builders\NotaFiscalBuilder;

// Retorna a soma do valor dos itens da nota fiscal
$notaFiscal->sumItemsValue();

// Retorna o array com a nota ja montada
$notaFiscal->toArray()

$notazz = new \RocheleEdenis\LaravelNotazz;

// Envia a requisição para o Notazz para registrar a nova nota
$notaFiscal = new NotaFiscalBuilder;
...
$notazz->register($notaFiscal);