Download the PHP package otifsolutions/currency-layer without Composer
On this page you can find all versions of the php package otifsolutions/currency-layer. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download otifsolutions/currency-layer
More information about otifsolutions/currency-layer
Files in otifsolutions/currency-layer
Package currency-layer
Short Description This Laravel package provides easy integration with Currency Layer Api along with complete list for countries with flag information. It also comes with command to auto sync rates for each currency
License MIT
Informations about the package currency-layer
Laravel Currency Layer
This Laravel package provides easy integration with Currency Layer Api along with complete list for countries with flag information. It also comes with command to auto sync rates for each currency
Requirements
How to use the Library
Install via Composer (Recommended)
Using Composer
Note :
This package works with database engine
myIsam
. If you are usingmysql database
then you have to change database engine tomyIsam
from config/database.php ->'connection' => 'mysql'
and make this change'engine' => 'myIsam'
Now, run the migrations
Then, run this command to populate all tables with countries, states, currencies etc data
Now follow the instructions below
Grab the access key by registering on CurrencyLayer, give the key to the app using artisan tinker
or by writing this line anywhere in the code, where yourAccessKey
(string) is the key you've got from the API
Set the numberOfDays
key (positive integer), where this is the data of how many days you want to keep:
Note:
To check what key you have set, try with
get
method like
and
If you have set the crlKey
somewhere in the code, remove that line
after first time execution. To reset or re-assign the key, you can use the same line.
But, it is recommended to use tinker to set the access key.
After setting all the things, you can now synchronize currency exchange rates data
Hit this command to fetch the exchange rates
Hit this command to remove the exchange rates
Now publish countries flags from package to your project
Note :
Commands
rates:delete
andrates:get
can only be executed when you set the keyscrlKey
anddaysRates
Relationships defined between Models
Model Country has OneToOne
relation and Currency
, ManyToMany
relation with Timezone
and OneToMany
relation with State
.
State Model has OneToMany
relation with City
Currency Model has OneToMany
relation with CurrencyRate
All versions of currency-layer with dependencies
ext-json Version *
ext-dom Version *
otifsolutions/curl-handler Version ^1
otifsolutions/laravel-settings Version ^1