Looking to hire Laravel developers? Try LaraJobs

laravel-sat-catalogs maintained by gam

Description
Provides a artisan command to automatically update SAT catalogs. Use a DB facade to access them.
Last update
2025/08/06 00:30 (dev-master)
License
Downloads
84

Comments
comments powered by Disqus

Gam/laravel-sat-catalogs

Source Code Total Downloads GitHub Workflow Status GitHub GitHub release (latest by date) Packagist PHP Version Support

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

  1. Set a sqlite3 connection for the driver catalogs. You can change the driver name in config/catalogs.php.
    Example:

    <?php
    /* Custom driver for CFDI Catalogs */
         'catalogs' => [
             'driver' => 'sqlite',
             'url' => '',
             'database' => database_path('catalogs.sqlite3'),
             'prefix' => '',
             'foreign_key_constraints' => true,
         ],
    
  2. Update the catalogs database

    # Si no se especifica --PATH los recursos se descargan en `storage/app/catalogs`
    php artisan catalogs:update --path={$MY_PATH}
    
  3. 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.