Currency
class Currency
Properties
protected array | $config | Currency configuration. |
|
protected Factory | $cache | Application cache |
|
protected CurrencyInterface | $model | Currency model instance. |
|
protected FormatterInterface | $formatter | Formatter instance. |
|
protected string | $userCurrency | User's currency |
|
protected Collection | $currenciesCache | Cached currencies |
|
protected Collection | $loadedCurrencies | Loaded currencies |
Methods
Create a new instance.
Format given number.
Format the value into the desired currency.
Format the value into a json array
Set user's currency.
Return the user's currency code.
Determine if the provided currency is valid.
Determine if the provided currency is active.
Return the current currency if the one supplied is not valid.
Return all currencies.
Get currency model.
Get formatter driver.
Clear cached currencies.
Get configuration value.
No description
No description
No description
Get a given value from the current currency.
Dynamically call the default driver instance.
Details
at line 67
__construct(array $config, Factory $cache)
Create a new instance.
at line 83
string
convert(float $amount, string $from = null, string $to = null, bool $format = true)
Format given number.
at line 122
string
format(float $value, string $code = null, bool $includeSymbol = true)
Format the value into the desired currency.
at line 186
string
formatToJson(float $value, string $code = null)
Format the value into a json array
at line 205
setUserCurrency(string $code)
Set user's currency.
at line 215
string
getUserCurrency()
Return the user's currency code.
at line 229
bool
hasCurrency(string $code)
Determine if the provided currency is valid.
at line 241
bool
isActive(string $code)
Determine if the provided currency is active.
at line 254
CurrencyInterface
getCurrency(string $code = null)
Return the current currency if the one supplied is not valid.
at line 274
Collection
getCurrencies()
Return all currencies.
at line 288
CurrencyInterface|Model
getModel()
Get currency model.
at line 306
FormatterInterface
getFormatter()
Get formatter driver.
at line 325
clearCache()
Clear cached currencies.
at line 338
mixed
config(string $key = null, mixed $default = null)
Get configuration value.
at line 347
protected
loadCurrencies()
No description
at line 360
updateRates($skipCache = false)
No description
at line 372
protected
getRates($base, $skipCache = false)
No description
at line 393
mixed
__get(string $key)
Get a given value from the current currency.
at line 406
mixed
__call(string $method, array $parameters)
Dynamically call the default driver instance.