Simple package providing an Artisan command to update the SAT Catalogs.
You can access them through the Catalog
Facade.
You can install the package via composer:
composer require gam/laravel-sat-catalogs
-
For lumen applications, register the provider in
bootstrap/app.php
file, add the following line:$app->register(\Gam\LaravelSatCatalogs\CatalogsServiceProvider::class);
-
Set a sqlite3 connection for the driver
catalogs
. You can change the driver name inconfig/catalogs.php
.
Example:<?php /* Custom driver for CFDI Catalogs */ 'catalogs' => [ 'driver' => 'sqlite', 'url' => '', 'database' => database_path('catalogs.sqlite3'), 'prefix' => '', 'foreign_key_constraints' => true, ],
-
Update the catalogs database
php artisan catalogs:update --path={$MY_PATH}
-
Access to the catalogs using
Catalog
Facade:# 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
composer dev:test
Please see CHANGELOG for more information what has changed recently.
Please see CONTRIBUTING for details.
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.
This package was generated using the Laravel Package Boilerplate.