fisharebest/laravel-floats
A Laravel package for handling floating-point numbers safely. It offers an Eloquent cast and helpers to store, retrieve, and compare floats without precision or locale issues, keeping decimal attributes consistent across your database and application.
FLOAT (4-byte single precision) rather than DECIMAL or DOUBLE — telemetry/measurement readings, sensor data, approximate geospatial coordinates, percentages — depends on being able to express that intent in a migration. This package is the enabler for that one decision.FLOAT columns, this package removes friction from that migration. That's a legitimate but narrow integration decision.DB::statement() calls that bypass the schema builder and are harder to review.Consider it when:
FLOAT semantics and you want it declared through Laravel's Blueprint API.float() method that produces what you need, and you want a drop-in macro rather than hand-rolled SQL.FLOAT.Look elsewhere / skip it when:
float() natively — verify this first; if it does, the package's value proposition largely evaporates and you're adding a dependency for nothing.DECIMAL; FLOAT is the wrong tool and no package fixes that.DB::statement() or a local macro in AppServiceProvider is a lower-risk equivalent.For executives: This is a tiny, free, MIT-licensed utility that lets our migrations declare MySQL FLOAT columns directly. It's not a platform decision or a cost centre — it's a five-minute unblock for one narrow schema need. The strategic value is near zero; the cost and risk are also near zero. Approve it as routine tooling, not as an initiative.
For engineering: Treat it as a candidate, not a default. Confirm whether our current Laravel version already covers this natively before adopting; if not, the package is a clean one-liner, but a local macro gives us identical behaviour with one fewer dependency and one fewer abandonment risk. If we do adopt it, pin the version, note the maintainer in the dependency register, and be ready to vendor the macro if the package goes quiet. Recommendation: evaluate-native-first; adopt only if we can't get FLOAT cleanly otherwise.
How can I help you explore Laravel packages today?