ownego / laravel-shopify-currency
Currency converter using Shopify's currencies cdn file
Installs: 3 508
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 4
Forks: 0
Open Issues: 0
Requires
- php: >=5.5.1
- ext-json: *
- illuminate/cache: >=5.1
- illuminate/console: >=5.1
README
This package created for convert between 2 currencies by using currencies.js file provided by Shopify.
Installation
-
Install package
composer require ownego/laravel-shopify-currency
-
Optional: add the service provider
'providers' => [ // ... Ownego\LaravelShopifyCurrency\LaravelShopifyCurrencyServiceProvider::class, ],
-
Optional: publish config
php artisan vendor:publish --provider=Ownego\LaravelShopifyCurrency\LaravelShopifyCurrencyServiceProvider
-
Optional: add facade
'alias' => [ // ... 'ShopifyCurrency' => Ownego\LaravelShopifyCurrency\Facades\ShopifyCurrency::class, ],
Usage
- Convert
use Ownego\LaravelShopifyCurrency\Facades\ShopifyCurrency; $result = ShopifyCurrency::convert(100, 'eur', 'usd');
- Get rate
use Ownego\LaravelShopifyCurrency\Facades\ShopifyCurrency; $result = ShopifyCurrency::rate('eur', 'usd');
Command
If you want to manually update currencies from cache, then run:
php artisan shopify-currency:cache