Download the PHP package elegantly/laravel-money without Composer

On this page you can find all versions of the php package elegantly/laravel-money. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-money

Elegant Integration of Brick/Money for Laravel

Latest Version on Packagist Total Downloads Tests Laravel Pint PHPStan

Table of Contents

Introduction

This package provides seamless, expressive integration of Brick/Money with Laravel. It enables safe, precise handling of monetary values in your application—using value objects, smart casting, robust parsing, and powerful validation tools.

Features

Installation

Install via Composer:

Configuration

Publish the configuration file if you need to customize defaults:

Default config (config/money.php):

Storing Money in the Database

For maximum precision, store money using:

This avoids floating-point precision issues and ensures accurate calculations.

Example migration:

Usage

Casting with a Currency Column (Recommended)

If your model stores both amount and currency, reference the currency column in the cast:

Casting with a Fixed Currency

If the currency is known and constant, define it directly:

Parsing Values

MoneyParser converts common numeric and string formats into Money instances:

The parser handles nullability, empty strings, integers, floats, and decimal string formats gracefully.

Validation Rule

Using ValidMoney in Livewire

Using ValidMoney in Form Requests

Testing

Run the test suite:

Changelog

See the CHANGELOG for a full history of updates.

Contributing

Contributions are welcome! Review the CONTRIBUTING file for details.

Security

If you discover a security vulnerability, please refer to the security policy.

Credits

License

This package is open-source software released under the MIT License. See LICENSE.md for details.


All versions of laravel-money with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
brick/money Version ^0.13.0
illuminate/contracts Version ^12.0||^13.0
spatie/laravel-package-tools Version ^1.13.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package elegantly/laravel-money contains the following files

Loading the files please wait ...