PHP code example of amkas / currency-converter

1. Go to this page and download the library: Download amkas/currency-converter library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

amkas / currency-converter example snippets


    \Amkas\CurrencyConverter\ConversionServiceProvider::class,
   

php artisan vendor:publish --provider="Amkas\CurrencyConverter\ConversionServiceProvider"

 Copying file [amkas\currency-converter\src\Models\CurrencyRate.php] to [app\Models\CurrencyRate.php]  DONE
 Copying file [amkas\currency-converter\src\config\currency_converter.php] to [config\currency_converter.php]  DONE
 Copying directory [amkas\currency-converter\src\database\migrations] to [database\migrations]  DONE
  

    use Amkas\CurrencyConverter\Facades\Currency;
    
    $convertedAmount = Currency::convertAmount(10, 'EUR');
  

    $convertedAmount = convertAmount(10, 'EUR');
  

    $convertedAmount = Currency::amount(10)
        ->from('EUR')
        ->to("USD")
        ->convert();
  

    $convertedAmount = amount(10)
        ->from("EUR")
        ->to("USD")
        ->convert();
  

php artisan converter:reset-cache

 php artisan vendor:publish --tag=amkas-currency-converter

 php artisan migrate