Laravel-money is an open source library that simplifies life to convert numbers from a database ('balance': 12340
) into money objects.
With all being said, you can calculate money, output it as a string, convert it between currencies online via API services as well as offline and more!
- PHP:
^7.4
or^8.0
guzzlehttp/guzzle
:^7.0
composer require postscripton/laravel-money
Publish the config file through:
php artisan vendor:publish --provider=PostScription\Money\MoneyServiceProvider
or
php artisan vendor:publish --tag=money
After all, the config file at config/money.php
should be modified for your own purposes.
- β° Quick start
- β Usage
- β Settings
- π² Currencies
- π΅ Money
- Static methods
- Object methods
- Getters
- Calculations
- Object manipulations
- Logical operations
- Other
- API services
Contributions are welcome and will be fully credited.
We accept contributions via Pull Requests on Github.
- PSR-2 Coding Standard - The easiest way to apply the conventions is to use PHP Code Sniffer just by running:
-
composer app:check-build
-
composer app:cs-fix
-
- Add tests! - Your patch won't be accepted if it doesn't have tests.
- Document any change in behaviour - Make sure the
README.md
and any other relevant documentation are kept up-to-date. - Create feature branches - Don't ask us to pull from your master branch.
- One pull request per a feature - If you want to do more than one thing, send multiple pull requests. Features must be atomic, that is, do not contain unnecessary things.
- Send coherent history - Make sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please squash them before submitting.
If you discover any security-related issues, please email postscripton.sp@gmail.com instead of using the issue tracker.
We would be really pleased if you considered helping us with:
- A brand-new name of the library in one word. At the same time it has to make sense, be meaningful. For example, Carbon sounds quite good.
- Logo. The README would look much better with an attractive banner-logo at the top.
Happy coding! ππβ¨οΈ
Laravel-money is an open-source library under the MIT license.