gam / laravel-sat-catalogs
Provides a artisan command to automatically update SAT catalogs. Use a DB facade to access them.
Requires
- php: ^8.0
- ext-zip: *
- guzzlehttp/guzzle: ^7.4
- illuminate/support: ^9.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.8
- orchestra/testbench: ^7.0.0
- phpunit/phpunit: ^9.0
This package is auto-updated.
Last update: 2024-10-30 02:10:44 UTC
README
Simple package providing an Artisan command to update the SAT Catalogs.
You can access them through the Catalog
Facade.
Installation
You can install the package via composer:
composer require gam/laravel-sat-catalogs
Usage
-
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
Testing
composer dev:test
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email antgam95@gmail.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.
Laravel Package Boilerplate
This package was generated using the Laravel Package Boilerplate.