offline-agency/laravel-bank-of-italy
Composer 安装命令:
composer require offline-agency/laravel-bank-of-italy
包简介
A simple Laravel package to information from the Bank of Italy
README 文档
README
A simple Laravel package to retrieve information from the Bank of Italy.
Installation
You can install the package via composer:
composer require offline-agency/laravel-bank-of-italy
You need to publish config file with:
php artisan vendor:publish --provider="OfflineAgency\LaravelBankOfItaly\LaravelBankOfItalyServiceProvider"
Usage
Currently, the package provides a method to retrieve exchange rates between currencies.
Basic
$exchange_rate = new ExchangeRate(); $exchange_rates = $exchange_rate->getExchangeRates(); foreach ($exchange_rates->getItems() as $exchange_rate) { dd($exchange_rate); /* OfflineAgency\LaravelBankOfItaly\Entities\ExchangeRate\ExchangeRate { +currency: "Dollaro USA" +currencyIsoCode: "USD" +currencyUicCode: "001" +rate: "1.0724" +rateConvention: "Quantità di valuta estera per 1 Euro" +referenceDate: "Y-m-d" } */ }
In this example, the method getExchangeRates() returns an instance of OfflineAgency\LaravelBankOfItaly\Entities\ExchangeRate\ExchangeRates. You can use the getItems() method to retrieve an array of ExchangeRate objects. Each ExchangeRate object contains the following properties:
- currency: The name of the currency (e.g., "Dollaro USA")
- currencyIsoCode: The ISO code of the currency (e.g., "USD")
- currencyUicCode: The UIC code of the currency (e.g., "001")
- rate: The exchange rate (e.g., "1.0724")
- rateConvention: The rate convention (e.g., "Quantità di valuta estera per 1 Euro")
- referenceDate: The reference date of the rate (format: Y-m-d)
Custom Query Parameters
You can also provide custom query parameters to filter the results. Here are the fields you can specify:
$exchange_rate = new ExchangeRate(); $response = $exchange_rate->getExchangeRates([ 'lang' => 'en', // Default: it 'baseCurrencyIsoCode' => 'EUR', // Default: USD 'currencyIsoCode' => 'ITL', // Default: EUR (accepted values: EUR, USD, ITL) 'startDate' => '01-01-2000', // Default: Carbon::now()->subYear() (format: Y-m-d) 'endDate' => '01-01-2000' // Default: Carbon::now() (format: Y-m-d) ]);
Error Handling
- If there is a validation error, the method returns an instance of
Illuminate\Support\MessageBag. - If there is an error during the API call, the method returns an instance of
OfflineAgency\LaravelBankOfItaly\Entities\Error, which contains an error property.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security-related issues, please email support@offlineagency.com instead of using the issue tracker.
Credits
About us
Offline Agency is a web design agency based in Padua, Italy. You'll find an overview of our projects on our website.
License
The MIT License (MIT). Please see License File for more information.
offline-agency/laravel-bank-of-italy 适用场景与选型建议
offline-agency/laravel-bank-of-italy 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 12 次下载、GitHub Stars 达 0, 最近一次更新时间为 2024 年 09 月 11 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「offline-agency」 「laravel-bank-of-italy」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 offline-agency/laravel-bank-of-italy 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 offline-agency/laravel-bank-of-italy 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 offline-agency/laravel-bank-of-italy 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
统计信息
- 总下载量: 12
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 10
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-09-11