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
Requires
- php: ^8.1
- ext-simplexml: *
- illuminate/contracts: ^10.0
- spatie/laravel-package-tools: ^1.14.0
Requires (Dev)
- laravel/pint: ^1.0
- nunomaduro/collision: ^7.9
- nunomaduro/larastan: ^2.0.1
- orchestra/testbench: ^8.0
- pestphp/pest: ^2.0
- pestphp/pest-plugin-arch: ^2.0
- pestphp/pest-plugin-laravel: ^2.0
- phpstan/extension-installer: ^1.1
- phpstan/phpstan-deprecation-rules: ^1.0
- phpstan/phpstan-phpunit: ^1.0
README
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.