2017 © Pedro Peláez
 

library exchange-rate

Package Laravel to currency conversion using ExchangeRate API.

image

quicktech-as/exchange-rate

Package Laravel to currency conversion using ExchangeRate API.

  • Thursday, June 15, 2017
  • by gilberto-bueno
  • Repository
  • 2 Watchers
  • 0 Stars
  • 7 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 40 % Grown

The README.md

Quicktech\ExchangeRate (Laravel 5 Package)

Quicktech\ExchangeRate is a succinct and flexible way to use ExchangeRate API to convert currencies in Laravel 5 applications., (*1)

Contents

Installation

1) In order to install Laravel 5, just add the following to your composer.json. Then run composer update:, (*2)

"quicktech-as/exchange-rate": "^1.0"

2) Open your config/app.php and add the following to the providers array:, (*3)

Quicktech\ExchangeRate\ExchangeRateServiceProvider::class,

3) In the same config/app.php and add the following to the aliases array:, (*4)

'ExchangeRate' => Quicktech\ExchangeRate\Facade\ExchangeRate::class,

4) Run the command below to publish the package config file config/exchange_rate.php:, (*5)

php artisan vendor:publish

Configuration

Open your .env file and setup your ExchangeRate credentials:, (*6)

EXCHANGERATE_DEFAULT_CURRENCY = 'your default currency'
EXCHANGERATE_API_KEY = 'your api key'
EXCHANGERATE_API_URI = 'https://v3.exchangerate-api.com'

Usage

Get rates based on default currency

To get all rates based on your defult currency, you can use this resource:, (*7)

$rates = ExchangeRate::rates();

The method above will return the following response:, (*8)

[
    "AUD" => 1.32230,
    "BGN" => 1.8096,
    "BRL" => 3.11,
    "..." => 1.31135,
    "..." => 7.473, etc. etc.
]

Convert currency value

To convert currency value, you can use this resource:, (*9)

$value = ExchangeRate::convert(10.00, 'USD', 'BRL');
// 31.11

License

Quicktech\ExchangeRate is free software distributed under the terms of the MIT license., (*10)

Contribution guidelines

Please report any issue you find in the issues page.
Pull requests are welcome., (*11)

The Versions

15/06 2017

v0.1.0

0.1.0.0

Package Laravel to currency conversion using ExchangeRate API.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Gilberto

laravel currency illuminate exchange rate

15/06 2017

v0.1.1

0.1.1.0

Package Laravel to currency conversion using ExchangeRate API.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Gilberto

laravel currency illuminate exchange rate

05/05 2017

dev-master

9999999-dev

Package Laravel to currency conversion using ExchangeRate API.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Gilberto

laravel currency illuminate exchange rate

05/05 2017

1.0.0

1.0.0.0

Package Laravel to currency conversion using ExchangeRate API.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Gilberto

laravel currency illuminate exchange rate