🌍 Introduction

Laravel Currency Formatter is an innovative Laravel package designed to handle currency values effectively with a focus on global financial applications. It leverages the power of PHP and the Laravel framework to introduce a simplified API that facilitates the formatting of currency values according to international standards.

Key Features

  • Supports a Wide Range of Global Currencies 🌐: From the United States Dollar (USD) to the Japanese Yen (JPY), and Bitcoin (BTC), this package offers support for a multitude of global currencies. Each currency is thoughtfully integrated with details such as the currency symbol, thousands separator, decimal separator, and symbol positioning.
"AED" => [
    "code" => "AED",
    "symbol" => "د.إ.‏",
    // Further configuration follows...
]
// Example of currency configuration
  • Customizable Formatting Options ⚙️: Users have the ability to adjust how monetary values are displayed. This includes configuring decimal places, deciding the symbol position (left or right of the value), and whether to include space between the amount and the symbol.
public function format(Float $money, Bool $zeroDecimals = false): String
{
    // Formatting logic based on currency options
}
// Example of formatting function
  • Easy-to-Use Facade for Quick Integration 🚀: The package provides a clear and concise facade, allowing developers to seamlessly integrate the functionality into their Laravel applications without deep diving into complex configurations.
use Magarrent\LaravelCurrencyFormatter\Facades\Currency;

Currency::currency('USD')->format(1234.56);
// Facade usage example

Usage

use Magarrent\LaravelCurrencyFormatter\Facades\Currency;

// Format $1234.56 as USD
echo Currency::currency('USD')->format(1234.56);

This simple yet powerful package is designed to take the complexity out of handling currency formatting in Laravel applications. Whether you are developing a financial dashboard, an e-commerce website, or any application that handles transactions in multiple currencies, Laravel Currency Formatter stands out as an indispensable tool.

For a comprehensive understanding of the package, including configuration and advanced usage, continue exploring our documentation.