Skip to content

Releases: ash-jc-allen/laravel-exchange-rates

Laravel Exchange Rates v3.3.0

06 Dec 00:42
Compare
Choose a tag to compare

New Features

Added support for PHP 8 (#50)

As of Laravel Exchange Rates v3.3.0, the package can now be run using PHP 8.

Laravel Exchange Rates v3.2.1

16 Sep 08:34
Compare
Choose a tag to compare

Laravel Exchange Rates v3.2.1

New Features

Updated the Travis CI config to run the tests correctly (#47)

The Travis CI config has now been updated so that it runs the test for this library against the correct version of PHP and Laravel. Previously, the Laravel version was being ignored and the tests were just being run against the latest version (at the time 7.28.0).

Laravel Exchange Rates v3.2.0

08 Sep 22:41
Compare
Choose a tag to compare

Laravel Exchange Rate v3.2.0

New Features

Added support for Laravel 8 (#46)

Laravel Exchanges Rates now has support for Laravel 8 and Guzzle 7.

Laravel Exchange Rates v3.1.0

01 Sep 21:32
Compare
Choose a tag to compare

Laravel Exchange Rate v3.1.0

New Features

Added a new ValidCurrency validation rule (#45)

Laravel Exchange Rates comes with its own ValidCurrency rule for validating currencies. This can be useful for if you need to be sure that a currency (maybe one provided by the user) is supported by the library.

The example below show how you can use the rule for validating the currency:

<?php
    
namespace App\Http\Controllers;

use AshAllenDesign\LaravelExchangeRates\Rules\ValidCurrency;
use Illuminate\Support\Facades\Validator;

class TestController extends Controller
{
    public function index()
    {
        $formData = [
            'currency' => 'GBP',
        ];

        $rules = [
            'currency' => new ValidCurrency,
        ];

        $validator = Validator::make($formData, $rules);
    }
}

Laravel Exchange Rates v3.0.0

14 Jul 23:34
b4fb915
Compare
Choose a tag to compare

Laravel Exchange Rate v3.0.0

New Features

Added functionality to get rates and converted values for more than one currency (#42)

This feature brings huge improvements to the performance and usage of this library. Previously, if you wanted to get the exchange rate for more than one exchange rate you would have to call the package's method multiple times (once for each currency).

As of Laravel Exchange Rates v3.0.0, you can now get the exchange rates and converted values for multiple currencies at once. This reduces the amount of requests that are needed to be made to the API and reduces overall load.

The example below show how to convert £1 'GBP' to 'EUR' and 'USD' at today's exchange rate.

$exchangeRates = new ExchangeRate();
$result = $exchangeRates->convert(100, 'GBP', ['EUR', 'USD'], Carbon::now());

// $result: [
//     'EUR' => 110.15884906,
//     'USD' => 125.30569081
// ];

Added a new ->shouldCache() method (#38)

A new ->shouldCache() method has now been added that can be used to determine whether if the exchange rate fetched via the API should be stored in the cache.

The example below shows how to use the new method get an exchange rate and not cache it:

<?php
    
    namespace App\Http\Controllers;
    
    use AshAllenDesign\LaravelExchangeRates\Classes\ExchangeRate;
    
    class TestController extends Controller
    {
        public function index()
        {
            $exchangeRates = new ExchangeRate();
            return $exchangeRates->shouldCache(false)->convert(100, 'GBP', 'EUR', Carbon::now());
        }
    }

Dropped Laravel 5.8 support (#41)

As of Laravel Exchange Rates v3.0.0, Laravel 5.8 is no longer supported. Therefore, you must be using a minimum of Laravel 6.0 to use this library.

Laravel Exchange Rates v2.2.0

30 May 01:28
Compare
Choose a tag to compare

Laravel Exchange Rates v2.2.0

New Features

Prevented API calls when getting the exchange rate for two of the same currency (#32)

Laravel Exchange Rates uses the exchangeratesapi.io service for fetching the exchange rates between different currencies. At the time of releasing v2.2.0, a bug exists in the API that caused an exception if trying to convert from EUR to EUR.

To solve this issue, a change has now been made that prevents any requests from being sent to the API if the from and to currencies are the same. This also brings some minor performance improvements.

Documentation update (#33)

This is only a small update purely for cosmetic reasons. It changes the list of support currencies in the documentation from an unordered list to a table.

Laravel Exchange Rates v2.1.0

05 Mar 14:21
a42c2d0
Compare
Choose a tag to compare

Laravel Exchange Rates v2.1.0

New Features

Added support for Laravel 7 (#28)

Laravel Exchange Rates now has support for Laravel 7!