Download the PHP package ez-laravel/currencies without Composer

On this page you can find all versions of the php package ez-laravel/currencies. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package currencies

EZ Laravel Currencies

This package provides your application with the functionality to use currencies and easily retrieve conversion rates and apply them to prices.

It makes use of external API's, some of which require an API key. You'll find more details in the instructions below.

Installation

Run the following command in your project directory to install the package:

Publish the migrations and seeds using the following command:

Run the migrations with:

Update your DatabaseSeeder.php class to load the new seeder and afterwards run the following commands to seed your database:

Run the following command to (optionally) publish the package's config file:

Configuration

Default currency

The default currency is set to EUR, which you can change by adding the following key to your .env file with the desired currency code:

Currency Conversion Rate API

The following APIs are supported or under development to be supported:

You can change the drive the package will use by adding the following key to your .env file:

Fixer

fixer

Get an API key from the fixer.io website and add it to your .env file:

RatesAPI

rates

The ratesapi.io website does not require an API key!

Frankfurter

frankfurter

The frankfurter.app website does not require an API key!

ExchangeRatesAPI

exchangerates

The exchangeratesapi.io website does not require an API key!

Usage

Available methods

Updating conversion rates

When you've just installed the package you should perform the following command to manually update all of your currencies conversion rates:

To keep the conversion rates up-to-date automatically schedule the above command to be ran every day (or at whatever interval you'd like) by updating your app/Console/Kernel.php file to include the following:

More information on task scheduling can be found here.

Extending the Currency model

In most applications you will want to create relationships between the Currency model and for example a Product model or Order model. To do this simply create your own Currency model which extends the EZ\Currencies\Models\Currency model and update the model path in the currencies.php config file.

So for example:

And in currencies.php

Contributing

If you'd like to contribute feel free to submit a PR request with your driver(s) or other improvements! Any other feedback is


All versions of currencies with dependencies

PHP Build Version
Package Version
Requires guzzlehttp/guzzle Version ^6.5
illuminate/support Version ^7.0
ez-laravel/model-services Version ^1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package ez-laravel/currencies contains the following files

Loading the files please wait ....