wilsilva/money

My first package, convert and management number in money
105 5
Install
composer require wilsilva/money
Latest Version:0.8.0
PHP:>=7.0
License:MIT
Last Updated:Oct 2, 2019
Links: GitHub  ·  Packagist
Maintainer: wilsilva

Laravel Convert Money

Latest Stable Version Latest Unstable Version Total Downloads License composer.lock

Introduction

My first package, convert number in money.

Installation

To install Money, just run the following command:

	composer require wilsilva/money

Configuration

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
];

	

Usage


	echo Money::convertNumberToMoney(99.90); // dump $ 99,90
	// or
	echo Money::convertMoneyToNumber("$ 99,90"); // dump float 99.90

Helpers

 convert_number_to_money(15.50, "BRL") // dump R$ 15,50

 convert_money_to_number("R$2000,00", "BRL") // dump 2000.00

 offer_descount("$100,00", 20, "USD") // $ 80,00

License

The Money Library is open-sourced software licensed under the MIT license.

Related Packages

oriceon/toastr-5-laravel

Easy toastr notifications for Laravel 5

502,600 79
php-tmdb/laravel

Laravel Package for TMDB ( The Movie Database ) API. Provides easy access to the...

53,312 160
oriceon/oauth-5-laravel

OAuth Service Provider for Laravel 5

1,669,304 173
artdarek/oauth-4-laravel

OAuth Service Provider for Laravel 4

522,424 677
narutimateum/toastr-5.2-laravel

toastr.js for Laravel 5.2 easy notification like growl for example

37,567 13