Laravel Money

Laravel Money

Laravel Money is a composer package by Ricardo Gobbo de Souza for working with and formatting money in Laravel projects.

Laravel money uses the moneyphp/money PHP package under the hood and gives you a bunch of helpers:

use Cknow\Money\Money;

echo Money::USD(500); // $5.00

This package includes a ton of advanced features for doing money operations, comparisons, aggregations, formatting, and parsing:

// Basic operations
Money::USD(500)->add(Money::USD(500)); // $10.00
Money::USD(500)->subtract(Money::USD(400)); // $1.00

// Aggregation
Money::min(Money::USD(100), Money::USD(200), Money::USD(300)); // Money::USD(100)

// Formatters
Money::USD(500)->format(); // $5.00

// Parsers
Money::parse('$1.00'); // Money::USD(100)

You can also create a custom formatter for your specific use-case:

Money::USD(500)->formatByFormatter(new MyFormatter());

Be sure to check out the advanced usage and included helper functions in the project’s README file. Also, check out the Money PHP documentation for complete details of what this package is capable of doing.

You can learn more about this package and check out the source code on GitHub at cknow/laravel-money.


Filed in: News / packages


Newsletter

Join the weekly newsletter and never miss out on new tips, tutorials, and more.

Laravel News Partners

Laravel Jobs

Laravel Developer
San Jose, CA
X3 Builders
Lead Front End Developer
Remote
continued
Full-Stack Laravel Developer
Cologne
Revive Interior
Intermediate PHP Developer (Full Stack | CakePHP | Laravel | Vue | jQuery)
Remote
continued
Senior PHP Developer (Full Stack | CakePHP | Laravel | Vue | jQuery)
Remote
continued
Laravel Developer
Amsterdam (partially remote possible)
Let's Book
Web Developer (Laravel)
Tweed Heads, New South Wales, AUSTRALIA
Tursa Employment & Training