currency-amount-converter/currency-amount-converter

A simple package that converts amount to other currency value.

v1.0.3 2023-04-09 01:03 UTC

This package is auto-updated.

Last update: 2024-05-04 11:48:26 UTC


README

Latest Version on Packagist GitHub Tests Action Status Total Downloads

Installation

You can install the package via composer:

composer require currency-amount-converter/currency-amount-converter

You can publish the config file with:

php artisan vendor:publish --tag="currency-amount-converter-config"

Usage

You can use method chaining:

use Currency\CurrencyConverter\CurrencyConverter;

$currency = new CurrencyConverter();
$currency->convert(1)->value();        // 59.05

$currency = new CurrencyConverter();
$currency->convert(1, 'PHP')->value(); // 59.05

$currency = new CurrencyConverter();
$currency->convert(1, 'BGN')->value(); // 1.9558

$currency = new CurrencyConverter();
$currency->convert(2, 'BGN')->value(); // 3.9116

Testing

composer test

Credits

License

The MIT License (MIT). Please see License File for more information.