Download the PHP package imagina/icurrency-module without Composer
On this page you can find all versions of the php package imagina/icurrency-module. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download imagina/icurrency-module
More information about imagina/icurrency-module
Files in imagina/icurrency-module
Package icurrency-module
Short Description This module manages currencies and conversions
License MIT
Informations about the package icurrency-module
Icurrency 💱
Installation
composer require imagina/icurrency
php artisan module:migrate Icurrency
php artisan db:seed --class=\\Modules\\Icurrency\\Database\\Seeders\\CurrencyTableSeederTableSeeder
Add middleware in acms/app/Http/Kernel.php
Note: This middleware expects the currency configuration within the object or from the request filter object. Example:
api/iquote/v1/products?setting={"currency":"COP"}
o api/iquote/v1/products?filter={"currency":"COP"}
, 'settings' have higher priority.
Add command for updates TRM in acms/app/Console/Kernel.php
Add .env your Api Key
Get your api key in currencyconverterapi
Free Forex API Rate Limits
Currency Pairs per Request: 2
Number of Requests per Hour: 100
Run the following command the first time after making the migration to synchronize the currencies at the current exchange rate, after this they will be updated automatically with cron job.
Add command in schedule Laravel in acms/app/Console/Kernel.php
Default Currencies Available
NAME | CODE |
---|---|
United States Dollar | USD |
Colombian Peso | COP |
Australian dollar | AUD |
Mexican Peso | MXN |
Euro | EUR |
Use Facade Currency
Add follow line on the class that you need use this Facade:
Methods Available
-
Convert a value:
-
Convert a value from one currency to another currency:
-
Get the current currency:
-
Set current currency:
- Get array with all current supported:
End Points
Route Base: https://yourhost/api/icurrency/v1/
-
Currencies
-
Attributes
NAME TYPE NULLABLE TRANSLATABLE name String ☐ ☑ code String ☐ ☐ symbol_left String ☐ ☐ symbol_right String ☐ ☐ decimal_place char ☐ ☐ value double ☐ ☐ status tinyInteger ☐ ☐ default_currency boolean ☐ ☐ options text ☐ ☐ -
Create.
- Method:
POST
- Requires Authentication: ☑
- Routes:
/currencies
- Post params (Example):
- Method:
- Read
- Method:
GET
- Requires Authentication: ☐
-
Routes:
/currencies
/currencies/id
-
Filters
search date order - Update
- Method:
PUT
- Requires Authentication: ☑
-
Routes:
/currencies/id
- Delete
- Method:
DELETE
- Requires Authentication: ☑
- Routes:
/currencies/id
-