Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Money Laravel Package

archtechx/money

A Laravel package for safe money handling. Its Eloquent cast, backed by brick/money, stores amounts as integers to avoid floating-point errors, with currency support, formatting helpers, and Blade components for displaying prices cleanly.

View on GitHub
Deep Wiki
Context7

A simple package for working with money.

Frequently asked questions about Money
How do I install archtechx/money in a Laravel application?
Install it with Composer using composer require archtechx/money. The package publishes no migrations and registers no service container bindings, so once the dependency is in place you can add the Money cast to a model column. It pulls in brick/money as the underlying value-object library, so plan to standardise on those Money objects. Review the configurable default currency and formatting locale before rollout.
Which Laravel versions does archtechx/money support?
The v0.5.4 release adds Laravel 13 support and contains no other changes, which raises the framework compatibility ceiling for the package. Check the composer.json constraint for the exact supported range before upgrading, since the package is pre-1.0 and constraints can move. If you are currently on Laravel 11 or 12, v0.5.4 is a safe patch bump that also prepares your app for a Laravel 13 upgrade.
How does the Money Eloquent cast store amounts in the database?
The cast stores amounts as integer minor units in the column, for example 1999 for 19.99 USD, and hydrates them into immutable Money value objects when you read the model. Because the underlying column is an integer, you avoid floating-point rounding errors entirely. You pair the amount column with a currency column, since the cast handles a single currency per column.
How do I validate money input with archtechx/money?
The package ships Laravel validation rules that parse and validate money input, so requests can accept values such as 19.99 and reject malformed or non-numeric input. Use the rules in form requests like any other Laravel rule. Values that pass validation can then be converted into Money objects rather than left as raw floats.
Can archtechx/money handle multiple currencies in one table?
Each cast column holds a single currency, so the typical setup is an integer amount column plus a separate currency column on the same record. That covers multi-currency rows as long as each record has one currency per amount column. If you need several currencies per record, use multiple amount and currency column pairs. Non-ISO or custom currency sets depend on what brick/money supports, so verify your currency codes early.
How do I format money in Blade templates with archtechx/money?
The package provides Blade components and helpers that format Money objects consistently using your configured locale and currency. Instead of calling number_format in views, pass the model attribute through the component or helper. This keeps prices formatted identically across the application and honours the package's formatting configuration.
Is archtechx/money stable enough for production?
It is pre-1.0 at v0.5.x, so semver allows breaking changes in minor releases and every upgrade should be treated as potentially breaking until v1.0. Contributor concentration is also high, so a maintenance stall would leave you pinned to an older Laravel major. The integration surface is small, though, which keeps the blast radius limited because swapping the cast out is a bounded refactor. Lock the version deliberately and pilot on a low-write model first.
How do I test models that use the Money cast?
Nothing special is required: factories can set the raw integer minor-unit values and currency column directly, and the model hydrates them as Money objects on retrieval. Assertions can compare formatted output or use the Money object's comparison methods. There is no request-scoped or container state to reset between tests, so the cast works normally in feature and unit tests.
Can I migrate existing decimal or float money columns to this cast?
Yes, but treat it as a data-shape change: convert the existing decimal or float column to integer minor units in a dedicated migration and keep or add a currency column. Run a verification query comparing pre- and post-conversion totals before applying the cast. Once the backfill is verified, apply the cast and route serialisers and formatting through the Money object instead of ad-hoc number_format calls. Do it one model at a time so rollback stays cheap.
What are the alternatives to archtechx/money?
The closest alternative is using brick/money directly, which this package wraps, and writing the Eloquent casting yourself. You can also build a custom cast per model or keep decimal columns with manual formatting, but that leaves floating-point handling and currency logic scattered across the codebase. archtechx/money mainly saves you the boilerplate of casts, validation rules, and Blade formatting in Laravel.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core
nodisrupt/laravel-agent
sierratecnologia/media-manager