Package Data | |
---|---|
Maintainer Username: | aharen |
Maintainer Contact: | hello@khusaam.com (Ahmed Khusaam) |
Package Create Date: | 2016-08-11 |
Package Last Update: | 2022-12-21 |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-11-15 15:25:20 |
Package Statistics | |
---|---|
Total Downloads: | 237 |
Monthly Downloads: | 2 |
Daily Downloads: | 0 |
Total Stars: | 1 |
Total Watchers: | 1 |
Total Forks: | 2 |
Total Open Issues: | 0 |
Simple class with Facade to handle money for Laravel 5. The class stores and calculates all money related value (eg: prices etc..) in Laari (Pennies)
composer require aharen/laravel-money
Add MoneyServiceProvider
to providers
in config/app.php
aharen\Money\MoneyServiceProvider::class,
Add Money
Facade to aliases
in config/app.php
Money => aharen\Money\MoneyManagerFacade::class,
Initiate from either Rufiyaa
$money = Money::fromRufiyaa(10);
or Laari
$money = Money::fromLaari(1000);
Expects the provided ammount to be added in Laari
$money->add(100);
Expects the provided ammount to be subtracted in Laari
$money->subtract(100);
There are 3 output options available:
Output in Laari
$money->inLaari();
Output in Rufiyaa
$money->inRufiyaa();
Output in Rufiyaa and Laari
$money->inRufiyaaAndLaari();