Skip to content

Latest commit

History

History
48 lines (30 loc) 路 1.03 KB

collection_methods.md

File metadata and controls

48 lines (30 loc) 路 1.03 KB

Currencies collection methods

The class Currencies is used in order to operate over a collection of currencies.

Get current currencies

Get all the chosen (current) currencies.

Methods

Currencies::get()

Returns: Illuminate\Support\Collection

Currencies::getCodesArray()

Returns: array as ["USD", "EUR", ...]

Usage

use PostScripton\Money\Currencies;

Currencies::get();              // Collection of currencies
Currencies::getCodesArray();    // ["USD", "EUR", ...]

All currencies are the same

Methods

Currencies::same(Currency|string ...$currencies)

Returns: bool

Usage

use PostScripton\Money\Currencies;

// Always true because <= 1 elements
Currencies::same();                                 // true
Currencies::same(currency('USD'));                  // true

Currencies::same('USD', currency('USD'));           // true
Currencies::same(currency('USD'), 'USD', 'RUB');    // false

馃搶 Back to the contents.