Releases: PostScripton/laravel-money
Releases · PostScripton/laravel-money
v4.2.0
What's Changed
- feat: add compare method for return int by @folez in #153
Full Changelog: v4.1.1...v4.2.0
v4.1.1
v4.1.0
Changed
- Improved static
min(),max(),avg()andsum()methods. They take a collection as their first argument as well (#145)
Added
- JSON serialization to Money (#142)
zero()method to Money (#144)- Blueprint macros
moneyandunsingedMoneyby @FoLez (#131) - Native calculator, in case, the BcMath extension is not loaded (#146)
negate()method to Money and Calculators (#147)
New Contributors
- @FoLez made their first contribution in #131
Full Changelog: v4.0.0...v4.1.0
v4.0.0
Version 4 is out 🎉🎊
It's been a long time since the last major version. We've been using version 3 a lot, however, I've had enough time to reconsider and refactor the vast majority of functionality. Here are the changes:
Changed
- Minimum PHP version is now
8.1(#64) - Minimum Guzzle version is now
7.5(40005b0) - Renamed
multiple()method tomultiply()inMoneyclass (#65) - Objects manipulate with other objects, not numbers (#66)
- Raising precision (#70)
- Renamed
Money::make()toMoney::of()(#78) equals()is now comparing amounts and currencies with the strict mode on (#79)getCurrency()andsetCurrency()have been moved toMoneyclass (#86)- New
Currenciesclass to work with collections of currencies (#93) - Reworked parser (#97)
- Most exceptions have been refactored (#102, #139)
difference()method now returns an absolute Money object, not a string (#106)- Renamed
Currency::getConfigCurrency()toCurrency::getConfigCurrencyCode()(564a7f2) - Accept strings as currencies in most places (b8f1d05)
- Renamed
isEmpty()toisZero()inMoneyclass (#122) - Nest settings that are related to formatting to the corresponding key in the config file (#128)
- Refactored
ServicestoRateExchangers(ExchangeRatesAPI has been replaced with Fixer as well) (#130)
Removed
MoneySettingshave gone (#114)- Currency list methods (#90)
Currency::getConfigCurrency()(564a7f2, a0a9296)
Fixed
- Custom currencies from the config file should override pre-defined currencies (#87)
- Cast to null no longer causes the error (#104)
Added
- Formatters in replacement of
MoneySettings(#114) CurrencyList,CurrencyPosition, andCurrencyPositionenums (#91)absolute()method (#107)money_parse()helper function (#109)- BcMath for calculations (#118)
Currency::get()andCurrency::getOrDefault()(917c98e)Currencies::same()checks that all passed currencies are the same (#124)isDifferentCurrency()as negative version ofisSameCurrency()(#127)
Full Changelog: v3.2.4...v4.0.0
v3.2.4
Fix cast nullable column to money
v3.2.3
Adjust validation rule to accept negative amount
v3.2.2
Symbol of Brazilian Real goes first by default
v3.2.1
Fix custom list in currencies