giordanolima/decimal-mutators
Decimal mutators for Laravel Eloquent models that automatically cast, store, and format fixed-point values with configurable precision, keeping monetary and decimal attributes accurate in the database and clean in your application.
Consider it when:
Look elsewhere (or defer) when:
$casts, accessors/mutators, withoutEvents-style patterns, or query-builder bulk inserts may already cover your bypass needs without a third-party dependency.For executives: This is a small, focused Laravel library that standardizes how model attributes get transformed, and its new 1.1.0 release adds a single global switch to turn that transformation off when we need raw data — during imports, backfills, and testing. It's a candidate to replace bespoke per-model logic with one maintained mechanism, reducing custom code we'd otherwise own. The trade-off is maturity: it's a 1.x package with a terse changelog, so we'd adopt it pinned to a version, behind our own tests, and with an explicit rule about when the global switch may be used.
For engineering: 1.1.0 introduces a static property to disable mutators globally, plus unspecified fixes. The win is a supported bypass path for seeding/imports/bulk writes and simpler raw-value assertions in tests. The risk is global mutable state: in Octane or long-running queue workers it can leak between requests and jobs, and an accidental flip could persist unmutated sensitive fields. Recommendation: adopt with an exact version pin, always wrap toggling in try/finally (or a helper), add a lint/test guard that asserts the flag is false at request/job boundaries, and read the 1.1.0 diff before merging since the changelog does not enumerate the fixes.
How can I help you explore Laravel packages today?