Download the PHP package msonowal/laraxchange without Composer

On this page you can find all versions of the php package msonowal/laraxchange. 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 laraxchange

Currency Conversions for Laravel 5.*

Latest Stable Version Total Downloads License

Laravel 5 Library for working with multi currency conversions currently using http://fixer.io/ API.

Supports the entire Laravel 5.* releases.

In contrary to all other packages wherein it requires that you have to configure your provider, this library calls a free service and works with zero setup configs. This package utilizes built in laravel cache driver for caching the conversion rates and it also provides commands for artisan lovers and which can be scheduled so that it will periodically updates your cache storage.

So you don't really have to worry about downloading/configuring API Keys.

It also provides a middleware which automatically determines the currency and set it for the Visitor if there are no currency set in the session which depends on GeoIp package

Just install the package, add the config and it is ready to use!

Requirements

Installation

composer require msonowal/laraxchange

Add the service provider and facade in your config/app.php

Service Provider

Msonowal\Laraxchange\Providers\CurrencyServiceProvider::class,

Aliases (Facade)

'Currency'      =>  Msonowal\Laraxchange\Facades\Currency::class,

Configuration

This library also supports optional configuration.

To get started, first publish the package config file:

It provides various built in helper methods to get the user currency or setting the currency

Usage

Set default currency of the visitor by using the middleware add this below in Kernal.php in app/http

'determine_currency'    =>  \Msonowal\Laraxchange\Middleware\SetDefaultUserCurrency::class,

Get ISO Currency_code of the visitor

getUserCurrency();  // returns "USD"

Get ISO Currency_code of the visitor

getUserCurrencySymbol();  // returns "$"

Get ISO Currency symbol of a currency

getCurrencySymbol("USD");  // returns "$"

Convert value from base currency to another currency on the fly

convertCurrency($value, "GBP");  // returns the value in GBP currency

Set base currency only for instance which can be changed on the fly

Currency::setBaseCurrency("GBP"); // sets the base currency as specified for that instance when default base currency is different

Get All Conversions list of the currencies based on the base currency specified

Currency::getRates();  // returns list of values fore each currency

Cache the conversion rates by using command

php artisan currency:cache;  // will cache currency conversion rates for each available currency specified in config `valid_currencies`

To cache the rates automatically add the command in your Kernal.php in app/Console directory below

$schedule->command('currency:cache')->daily()->at('12:00');  // will cache currency conversion rates for each available currency specified in config `valid_currencies`

There are so many other methods which can be explored by yourself

Credits


All versions of laraxchange with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0
illuminate/support Version 5.5.*|5.6.*|5.7.*
illuminate/cache Version 5.5.*|5.6.*|5.7.*
illuminate/session Version 5.5.*|5.6.*|5.7.*
guzzlehttp/guzzle Version ~6.2
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 msonowal/laraxchange contains the following files

Loading the files please wait ....