A simple Laravel package to information from the Bank of Italy
offline-agency/laravel-bank-of-italy is a Laravel package for a simple laravel package to information from the bank of italy.
It currently has 0 GitHub stars and 12 downloads on Packagist (latest version 1.0.1).
Install it with composer require offline-agency/laravel-bank-of-italy.
Discover more Laravel packages by offline-agency
or browse all Laravel packages to compare alternatives.
Last updated
A simple Laravel package to retrieve information from the Bank of Italy.
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"
Currently, the package provides a method to retrieve exchange rates between currencies.
$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:
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)
]);
Illuminate\Support\MessageBag.OfflineAgency\LaravelBankOfItaly\Entities\Error, which contains an error property.Please see CONTRIBUTING for details.
If you discover any security-related issues, please email [email protected] instead of using the issue tracker.
Offline Agency is a web design agency based in Padua, Italy. You'll find an overview of our projects on our website.
The MIT License (MIT). Please see License File for more information.