PHP code example of motamonteiro / sefaz-portal

1. Go to this page and download the library: Download motamonteiro/sefaz-portal 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/ */

    

motamonteiro / sefaz-portal example snippets

 bash
php artisan key:generate
 bash
php artisan vendor:publish
 php
/**
     * The event listener mappings for the application.
     *
     * @var array
     */
    protected $listen = [
        'MotaMonteiro\Sefaz\Portal\Events\ServidorApiNaoRespondeuEvent' => [
            'MotaMonteiro\Sefaz\Portal\Listeners\ServidorApiIndisponivelListener',
        ],
        'MotaMonteiro\Sefaz\Portal\Events\ServidorApiNaoRespondeuCorretamenteEvent' => [
            'MotaMonteiro\Sefaz\Portal\Listeners\ServidorApiRespostaInvalidaListener',
        ],
    ];
 php


Route::get('/', ['as' => 'exemplo', 'middleware' => 'portal:COD_FUNCAO', 'uses' => 'ExemploController@index']);
 php


namespace App\Http\Controllers;

class ExemploController extends Controller
{
    public function index()
    {
        return view('exemplo');
    }
}