PHPackages                             konekt/laravel-migration-compatibility - 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. konekt/laravel-migration-compatibility

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

konekt/laravel-migration-compatibility
======================================

Library to help migrations to figure out whether a related field is int or bigInt

1.11.0(2mo ago)0232.6k↑559.3%1[2 PRs](https://github.com/artkonekt/laravel-migration-compatibility/pulls)7MITPHPPHP ^8.3CI failing

Since Aug 18Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/artkonekt/laravel-migration-compatibility)[ Packagist](https://packagist.org/packages/konekt/laravel-migration-compatibility)[ RSS](/packages/konekt-laravel-migration-compatibility/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (8)Versions (23)Used By (7)

Laravel Migration Compatibility
===============================

[](#laravel-migration-compatibility)

[![Tests](https://camo.githubusercontent.com/7646c8e05c7bc08132027f906c14d698977b41efb4eacb4d85cb62bbd5f1d06d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6172746b6f6e656b742f6c61726176656c2d6d6967726174696f6e2d636f6d7061746962696c6974792f74657374732e796d6c3f6272616e63683d6d6173746572267374796c653d666c61742d737175617265)](https://github.com/artkonekt/laravel-migration-compatibility/actions?query=workflow%3Atests)[![Packagist Stable Version](https://camo.githubusercontent.com/c1795b3daf925dbb356788565905af66fbf14ad8db3c2182532651955e17605d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6b6f6e656b742f6c61726176656c2d6d6967726174696f6e2d636f6d7061746962696c6974792e7376673f7374796c653d666c61742d737175617265266c6162656c3d737461626c65)](https://packagist.org/packages/konekt/laravel-migration-compatibility)[![Packagist downloads](https://camo.githubusercontent.com/7ea351589ca812b67c45318db9aaf4dedb86c1a76c8fba0bc6448ef72b85e04d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6b6f6e656b742f6c61726176656c2d6d6967726174696f6e2d636f6d7061746962696c6974792e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/konekt/laravel-migration-compatibility)[![StyleCI](https://camo.githubusercontent.com/a95e549c3aa1b89804519625ecb95f9819220bdda3dc537dc919f5acb4c13837/68747470733a2f2f7374796c6563692e696f2f7265706f732f3139373335393333342f736869656c643f6272616e63683d6d6173746572)](https://styleci.io/repos/197359334)[![MIT Software License](https://camo.githubusercontent.com/942e017bf0672002dd32a857c95d66f28c5900ab541838c6c664442516309c8a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)

Laravel 5.8 And The BigInt Problem
----------------------------------

[](#laravel-58-and-the-bigint-problem)

As of [Laravel 5.8](https://github.com/laravel/framework/pull/26472), migration stubs use the `bigIncrements` method on ID columns by default. Previously, ID columns were created using the increments method.

Foreign key columns must be of the same type. Therefore, a column created using the increments method can not reference a column created using the bigIncrements method.

This small change is a big [source of problems](https://laraveldaily.com/be-careful-laravel-5-8-added-bigincrements-as-defaults/)for **packages** that define references to the **default Laravel user table**.

This package helps to solve this problem by extending Laravel's `Blueprint` class by a method that can detect the actual referenced field type:

```
class CreateProfilesTable extends Migration
{
    public function up()
    {
        Schema::create('profiles', function (Blueprint $table) {
            $table->increments('id');

            // Make `user_id` field the same type as the `id` field of the `user` table:
            $table->intOrBigIntBasedOnRelated('user_id', Schema::connection(null), 'users.id');

            //...

            $table->foreign('user_id')
                ->references('id')
                ->on('users');
        });
    }
//...
```

Installation
------------

[](#installation)

```
composer require konekt/laravel-migration-compatibility
```

Documentation
-------------

[](#documentation)

For detailed usage and examples go to the [Documentation](https://konekt.dev/migration-compatibility)or refer to the markdown files in the `docs/` folder of this repo.

For the list of changes read the [Changelog](Changelog.md).

###  Health Score

59

—

FairBetter than 98% of packages

Maintenance85

Actively maintained with recent releases

Popularity35

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity83

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 100% 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

Recently: every ~207 days

Total

22

Last Release

78d ago

PHP version history (6 changes)1.0.0PHP ^7.1.3

1.2.x-devPHP ^7.2

1.4.0PHP ^7.3|^8.0

1.5.0PHP ^8.0

1.10.0PHP ^8.1

1.x-devPHP ^8.3

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/5520702?v=4)[konekt](/maintainers/konekt)[@konekt](https://github.com/konekt)

---

Top Contributors

[![fulopattila122](https://avatars.githubusercontent.com/u/1162360?v=4)](https://github.com/fulopattila122 "fulopattila122 (94 commits)")

---

Tags

laravelmigrationdatabasekonektartkonekt

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/konekt-laravel-migration-compatibility/health.svg)

```
[![Health](https://phpackages.com/badges/konekt-laravel-migration-compatibility/health.svg)](https://phpackages.com/packages/konekt-laravel-migration-compatibility)
```

###  Alternatives

[mongodb/laravel-mongodb

A MongoDB based Eloquent model and Query builder for Laravel

7.1k8.4M96](/packages/mongodb-laravel-mongodb)[yajra/laravel-oci8

Oracle DB driver for Laravel via OCI8

8793.2M25](/packages/yajra-laravel-oci8)[konekt/enum-eloquent

Enum attribute casting for Eloquent models

632.2M20](/packages/konekt-enum-eloquent)[dragon-code/laravel-data-dumper

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

3422.6k](/packages/dragon-code-laravel-data-dumper)[aimeos/laravel-nestedset

Nested Set Model for Laravel

3714.4k6](/packages/aimeos-laravel-nestedset)[itpathsolutions/dbstan

Database Standardization and Analysis Tool for Laravel

492.8k](/packages/itpathsolutions-dbstan)

PHPackages © 2026

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