PHPackages                             fisharebest/laravel-floats - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. fisharebest/laravel-floats

ActiveLibrary[Database &amp; ORM](/categories/database)

fisharebest/laravel-floats
==========================

Floating point support for Laravel migrations

1.5.0(5y ago)1111.4k2[2 issues](https://github.com/fisharebest/laravel-floats/issues)MITPHPPHP ~5.6|~7.0CI failing

Since Feb 19Pushed 3y ago1 watchersCompare

[ Source](https://github.com/fisharebest/laravel-floats)[ Packagist](https://packagist.org/packages/fisharebest/laravel-floats)[ RSS](/packages/fisharebest-laravel-floats/feed)WikiDiscussions main Synced 2mo ago

READMEChangelogDependencies (3)Versions (8)Used By (0)

[![License: MIT](https://camo.githubusercontent.com/fdf2982b9f5d7489dcf44570e714e3a15fce6253e0cc6b5aa61a075aac2ff71b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d79656c6c6f772e737667)](https://opensource.org/licenses/MIT)[![Latest Stable Version](https://camo.githubusercontent.com/287490c2da681064a375bb3792208970c6f331d5e6c2960c4d94a9da761c8967/68747470733a2f2f706f7365722e707567782e6f72672f66697368617265626573742f6c61726176656c2d666c6f6174732f762f737461626c652e737667)](https://packagist.org/packages/fisharebest/laravel-floats)[![Build Status](https://camo.githubusercontent.com/1c4baf2caa38ad0793289420d7a3343e62054e12354ae9cd2577c6cb4213278d/68747470733a2f2f7472617669732d63692e6f72672f66697368617265626573742f6c61726176656c2d666c6f6174732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/fisharebest/laravel-floats)[![Coverage Status](https://camo.githubusercontent.com/dcc8205e85bbeba603f54e0c22e7083676ecf01be3a20add216b00869baa47b7/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f66697368617265626573742f6c61726176656c2d666c6f6174732f62616467652e7376673f6272616e63683d6d617374657226736572766963653d676974687562)](https://coveralls.io/github/fisharebest/laravel-floats?branch=master)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/5fe51e51cc169e23eda3dc1b670bfeae0f6d38e701ca2ebbb7895b80ea8fa036/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f66697368617265626573742f6c61726176656c2d666c6f6174732f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/fisharebest/laravel-floats/?branch=master)

laravel-floats
==============

[](#laravel-floats)

This package allows database migrations in Laravel 5, Laravel 6 and Laravel 7 to create `FLOAT` columns in MySQL.

Huh? You mean that Laravel does not support floating point columns?
-------------------------------------------------------------------

[](#huh-you-mean-that-laravel-does-not-support-floating-point-columns)

Sadly no. It only supports *double-precision* floating point columns. If you want *single-precision* floating point, you need to use `DB::raw()`.

This is despite the Laravel documentation at which states:

> `$table->float('amount', 8, 2);` FLOAT equivalent column with a precision (total digits) and scale (decimal digits).

> `$table->double('amount', 8, 2);` DOUBLE equivalent column with a precision (total digits) and scale (decimal digits).

You can read all about it at [laravel/framework#3151](https://github.com/laravel/framework/issues/3151)and many other issues.

In your migrationLaravel 5.0 - 7.0With this package`$table->float('col');``DOUBLE(8,2)``FLOAT``$table->float('col', 0);``DOUBLE``FLOAT``$table->float('col', 5);``DOUBLE(5,2)``FLOAT``$table->float('col', 5, 3);``DOUBLE(5,3)``FLOAT(5,3)``$table->double('col');``DOUBLE``DOUBLE``$table->double('col', 0);``DOUBLE``DOUBLE``$table->double('col', 5);``DOUBLE``DOUBLE``$table->double('col', 5, 3);``DOUBLE(5,3)``DOUBLE(5,3)`Installation
------------

[](#installation)

```
composer require fisharebest/laravel-floats

```

Package discovery takes care of everything on Laravel 5.5 and later. If you're using Laravel 5.4 or earlier, you'll need to replace an alias in `config/app.php`.

```
'aliases' => [
    ...
    'Schema' => \Fisharebest\LaravelFloats\Schema::class,
    ....
]

```

NOTE: this assumes you are using Laravel to autoload your facades using the aliases.

If you explicitly import Laravel's schema builder using `use Illuminate\Support\Facades\Schema;` then you will need to change this to `use Fisharebest\LaravelFloats\Schema;`.

How does this package work?
---------------------------

[](#how-does-this-package-work)

We extend the MySQL Grammar, modify the blueprint for `float()`, and then bind the updated grammar back into the IoC container.

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance16

Infrequent updates — may be unmaintained

Popularity29

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 92.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~116 days

Total

6

Last Release

2056d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2306088?v=4)[Greg Roach](/maintainers/fisharebest)[@fisharebest](https://github.com/fisharebest)

---

Top Contributors

[![fisharebest](https://avatars.githubusercontent.com/u/2306088?v=4)](https://github.com/fisharebest "fisharebest (12 commits)")[![kfina91](https://avatars.githubusercontent.com/u/72922128?v=4)](https://github.com/kfina91 "kfina91 (1 commits)")

---

Tags

laravelmigrationmysqlDoublefloat

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/fisharebest-laravel-floats/health.svg)

```
[![Health](https://phpackages.com/badges/fisharebest-laravel-floats/health.svg)](https://phpackages.com/packages/fisharebest-laravel-floats)
```

###  Alternatives

[kirschbaum-development/eloquent-power-joins

The Laravel magic applied to joins.

1.6k25.2M34](/packages/kirschbaum-development-eloquent-power-joins)[awssat/laravel-sync-migration

Laravel tool helps to sync migrations without refreshing the database

10923.2k](/packages/awssat-laravel-sync-migration)[dragon-code/laravel-data-dumper

Adding data from certain tables when executing the `php artisan schema:dump` console command

3418.6k](/packages/dragon-code-laravel-data-dumper)[yadakhov/laradump

A mysqldump wrapper for laravel. Dump your table schemas and data into files.

2517.7k](/packages/yadakhov-laradump)[cviebrock/eloquent-typecast

Trait for Eloquent models to force type-casting on retrieved values

2468.0k](/packages/cviebrock-eloquent-typecast)[mpyw/laravel-mysql-system-variable-manager

A tiny extension of MySqlConnection that manages session system variables

115.8k](/packages/mpyw-laravel-mysql-system-variable-manager)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
