PHP code example of gam / laravel-sat-catalogs

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

    

gam / laravel-sat-catalogs example snippets


   
   /* Custom driver for CFDI Catalogs */
        'catalogs' => [
            'driver' => 'sqlite',
            'url' => '',
            'database' => database_path('catalogs.sqlite3'),
            'prefix' => '',
            'foreign_key_constraints' => true,
        ],
   
 
   # check if catalog exists
   Catalog::exists('cfdi_40_productos_servicios');
   
   # get a list of catalogs name
   Catalog::availables()
   
   # Get a Query Builder instance
   $ps = Catalog::of('cfdi_40_productos_servicios');
   echo $ps->find('10161511')->texto
   
   # Get the text value of certain row
   $monedaText = Catalog::textOf('cfdi_40_monedas', 'MXN');
   echo $monedaText; # Peso Méxicano
   
shell
   php artisan catalogs:update --path={$MY_PATH}