norse-blue/laravel-banxico

0.1.1 2023-03-26 23:21 UTC

This package is auto-updated.

Last update: 2024-12-13 18:49:19 UTC


README

Laravel Banxico

Stable Release Build Status PHP Version Test Coverage Maintainability Total Downloads License

Laravel Banxico is a Laravel package that contains an HTTP Client implementation for Banxico's SIE API to request series data and metadata.

Installation

Requirements:

Install this package using Composer:

composer require norse-blue/laravel-banxico

You can publish the config file with:

php artisan vendor:publish --provider="NorseBlue\LaravelBanxico\BanxicoServiceProvider" --tag="settings"

Using Spatie\LaravelSettings package for configuration is also possible.

Usage

The easiest way to use the package is with the facade:

Banxico::getSeriesData(
    BanxicoSeries::combine(
        BanxicoSeries::ExchangeRate_USD_SettleObligationsDate,
        BanxicoSeries::ExchangeRate_EUR_BasketSDR,
    ),
    now()->subDays(7),
    now(),
);

This example retrieves the last 7 days of data for the specified series.

Changelog

Please refer to the CHANGELOG.md file for more information about what has changed recently.

Contributing

Contributions to this project are accepted and encouraged. Please read the CONTRIBUTING.md file for details on contributions.

Credits

Security

Please review our security policy to know how to report security vulnerabilities within this package.

Support the development

Do you like this project? Support it by donating

Buy me a coffee

License

This package is open-sourced software licensed under the MIT license.