My first package, convert number in money.
To install Money, just run the following command:
composer require wilsilva/money
After installing the Money library, register the WilSilva\Money\MoneyServiceProvider in your config/app.php configuration file:
'providers' => [
// Other service providers...
WilSilva\Money\MoneyServiceProvider::class,
],Add the MoneyFacade facade to the aliases array in your app configuration file:
'Money' => WilSilva\Money\Facade\MoneyFacade::class,To publish the config settings in Laravel 5 use:
php artisan vendor:publish --provider="WilSilva\Money\MoneyServiceProvider"
If you change type money, only to change in config/money.php
<?php //config file
return [
'money-type' => 'USD', // change to BRL for example
];
echo Money::convertNumberToMoney(99.90); // dump $ 99,90
// or
echo Money::convertMoneyToNumber("$ 99,90"); // dump float 99.90The Money Library is open-sourced software licensed under the MIT license.