investbrainapp/frankfurter-client
Composer 安装命令:
composer require investbrainapp/frankfurter-client
包简介
Laravel SDK for interacting with the Frankfurter currency exchange API
README 文档
README
This is a simple wrapper for the fantastic Frankfurter API.
Installation
Use composer to install:
composer require investbrainapp/frankfurter-client
Usage
This package provides a simple Laravel facade that exposes all functionality provided by the Frankfurter API.
Latest
To get the latest exchange rate use the latest method:
return Frankfurter::latest();
Historical
To get a historic exchange rate, pass a well formated date string or a DateTime object to the historical method:
return Frankfurter::historical('2025-01-01');
Time series
To get time series data for a range of dates, pass well formated date strings or DateTime objects to the timeSeries method:
return Frankfurter::timeSeries('2023-01-01', '2024-12-31');
If you want all rates between a date in the past and today's date, you can omit the second argument to the timeSeries method:
return Frankfurter::timeSeries('2023-01-01');
Supported currencies
You can call the currencies method to get a list of all supported currencies:
return Frankfurter::currencies();
Other methods
You can pass an array to the setSymbols method to limit the query to only specified symbols:
Frankfurter::setSymbols(['INR','JPY','GBP'])->latest();
You can also set the base currency using the setBaseCurrency method:
Frankfurter::setBaseCurrency(['GBP'])->latest();
Configuration
You can publish the frankfurter.php config file by running:
php artisan vendor:publish --provider="Investbrain\Frankfurter\FrankfurterServiceProvider" --tag=config
In the config file, you can adjust your base currency and the base url (if you're self hosting Frankfurter).
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2025-02-08