PHP code example of mateusfbi / totvs-rm-soap-laravel

1. Go to this page and download the library: Download mateusfbi/totvs-rm-soap-laravel 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/ */

    

mateusfbi / totvs-rm-soap-laravel example snippets

 artisan vendor:publish --tag=config

use Illuminate\Routing\Controller;
use mateusfbi\TotvsRmSoap\Services\DataServer;

class MeuController extends Controller
{
    public function buscarDados(DataServer $ds)
    {
        $ds->setDataServer("GlbColigadaDataBR");
        $ds->setContexto("CODSISTEMA=G;CODCOLIGADA=0;CODUSUARIO=mestre");
        $ds->setFiltro("1=1");
        $result = $ds->readView();

        if (array_key_exists('GColigada', $result)) {
            $result = $result['GColigada'];
        } else {
            $result = [];
        }

        dd($result);
    }
}

$ds = app('totvs.data_server');
$ds->setDataServer("GlbColigadaDataBR");
$ds->setContexto("CODSISTEMA=G;CODCOLIGADA=0;CODUSUARIO=mestre");
$ds->setFiltro("1=1");
$result = $ds->readView();

// ...