The Awesome Set of Packages for Laravel - The Formatter.

4.2.1 2023-05-15 06:53 UTC


This package is the part of Awesome Set of Packages for Laravel.

Read more.

This package provides a customizable wrapper around Intl formatters.


composer require lastdragon-ru/lara-asp-formatter

Usage & Configuration

Formatter is very simple to use:

use Illuminate\Container\Container;
use LastDragon_ru\LaraASP\Formatter\Formatter;

$formatter = Container::getInstance()->make(Formatter::class); // For default app locale
$formatter = $formatter->forLocale('ru_RU'); // For ru_RU locale

$formatter->string(123);        // '123'
$formatter->decimal(123.45);    // '123,45'

Please check source code to see available methods and config example to available settings 🤗