Currency class provides a wrapper around Brick\Money\Currency with additional formatting and configuration options specific to Laravel Brick Money.
Class Definition
Macroable trait, allowing you to extend it with custom methods.
Creating Currency Instances
of()
of()
Configuration Methods
currencies()
currencies()
jsonSerializer()
jsonSerializer()
Basic Information Methods
getCode()
getCode()
getName()
getName()
getNumericCode()
getNumericCode()
getSymbol()
getSymbol()
Symbol Position Methods
isSymbolFirst()
isSymbolFirst()
isSymbolSpaced()
isSymbolSpaced()
Decimal Format Methods
getDecimalPlaces()
getDecimalPlaces()
getDecimalSeparator()
getDecimalSeparator()
Thousand Format Methods
getThousandPlaces()
getThousandPlaces()
getThousandSeparator()
getThousandSeparator()
Underlying Instance Methods
getCurrency()
getCurrency()
Comparison Methods
is()
is()
Serialization Methods
toArray()
toArray()
toJson()
toJson()
jsonSerialize()
jsonSerialize()
__toString()
__toString()
Complete Usage Example
Here’s a comprehensive example showing various Currency methods:Macroable
The Currency class uses Laravel’sMacroable trait, allowing you to add custom methods: