Releases: PostScripton/laravel-money
v3.0
Good day, everyone 👋🏻
It's been a while since the last version of this package.
Change log
First and foremost, I hasten to tell you that all the documentation was reworked and rewritten. Have a good time and experience reading new docs 📚📖
❗️ Take into account that version
3.0
has lots of breaking changes and has no backward compatibility. So I do recommend you not to use older versions because I consider they are quite raw comparing to this completely new one.
All information regarding this update is listed here with all the labels and written comments.
v2.2.1
Currencies Update
Currencies Update has brought lots of features related to the Currencies.
README.md
documentation is up-to-date with all of the new features.
Numeric codes!
Numeric codes are here! Now you can get a currency not only by ISO-code (3 letters) but also by numeric code.
However, it is still a string because some currency codes start with 0
at the beginning like 012
.
use PostScripton/Money/Currency;
$usd = Currency::code('840');
$usd = Currency::code('USD');
Currency Lists
First of all, Currency Lists were added and you can choose one of them:
all_currencies
- contains almost all the currencies in the world.popular_currencies
- contains only 35 of the most traded currencies on the marketplace.
If you find an issue with a currency in some of the lists, please, open a new issue on:
https://github.com/PostScripton/laravel-money/issues
In order to choose the list by default, go to config/money.php
and choose one of the two lists.
If you need to select another list run-time in the code:
use PostScripton/Money/Currency;
Currency::setCurrencyList(Currency::LIST_ALL);
More info
Now currency objects have more information about a currency. Here are the new methods:
getFullName()
- returns a full name of a currency, e.g. "United States dollar"getName()
- returns just a name of a currency, e.g. "dollar"getNumCode()
- returns a numeric code, e.g. "840"getSymbol()
- quite complex method because it depends on many situative parameters:
4.1. If a currency has more than one symbol, pass an index as the first parameter to choose one.
4.2. If a currency has one symbol, it is returned.
4.3. If a currency has a display as ISO-code, then ISO-code is returned instead of a symbol.
Display symbol
In this version, you can specify whether you want to have a symbol or ISO-code in money to be displayed.
use PostScripton/Money/Currency;
$usd = Currency::code('USD')->setDisplay(Currency::DISPLAY_CODE);
// Currency::DISPLAY_CODE
// Currency::DISPLAY_SYMBOL
$money = Money::make(1234, $usd);
$money->toString(); // "USD 123.4"
$money->settings->getCurrency()->setPosition(Currency::POS_END);
$money->toString(); // "123.4 USD"
v2.1.0
Some methods for Money were added:
add()
subtract()
rebase()
And they were written down in the README.md
v2.0.0
v1.1.0
Исправил баг с конвертацией валют.
Конфиг файл стал более понятным и красивым.
v1.0.3
Изменил путь до файла конфигурации
v1.0.2
Обновил namespace для MoneyServiceProvider
в composer.json
v1.0.1
Merge pull request #2 from PostScripton/release v1.0.1 - Bug fixes
First working release
v1.0.0 v1.0.0