Skip to content

Releases: PostScripton/laravel-money

v3.0

22 Aug 14:54
Compare
Choose a tag to compare

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

06 May 20:34
92b250a
Compare
Choose a tag to compare

Change log: #12

Currencies Update

04 May 13:16
c9a2543
Compare
Choose a tag to compare

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:

  1. all_currencies - contains almost all the currencies in the world.
  2. 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:

  1. getFullName() - returns a full name of a currency, e.g. "United States dollar"
  2. getName() - returns just a name of a currency, e.g. "dollar"
  3. getNumCode() - returns a numeric code, e.g. "840"
  4. 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

30 Apr 13:38
5c88b69
Compare
Choose a tag to compare

Some methods for Money were added:

  1. add()
  2. subtract()
  3. rebase()

And they were written down in the README.md

v2.0.0

28 Apr 11:14
dca0374
Compare
Choose a tag to compare

Change log: #7

v1.1.0

27 Mar 13:04
Compare
Choose a tag to compare

Исправил баг с конвертацией валют.
Конфиг файл стал более понятным и красивым.

v1.0.3

27 Mar 09:40
Compare
Choose a tag to compare

Изменил путь до файла конфигурации

v1.0.2

26 Mar 22:08
4c0e101
Compare
Choose a tag to compare

Обновил namespace для MoneyServiceProvider в composer.json

v1.0.1

26 Mar 21:49
594a65e
Compare
Choose a tag to compare
Merge pull request #2 from PostScripton/release

v1.0.1 - Bug fixes

First working release

26 Mar 21:25
Compare
Choose a tag to compare
v1.0.0

v1.0.0