PHPackages                             thiagobrauer/laravel-incremental-migrations - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. thiagobrauer/laravel-incremental-migrations

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

thiagobrauer/laravel-incremental-migrations
===========================================

This Laravel package extends the command php artisan make:migration to add an incremental number at the end of a migration file, if there is already another migration with the same name. It also has its own artisan command to fix the names of the existing migrations.

077PHP

Since Apr 3Pushed 5y ago1 watchersCompare

[ Source](https://github.com/thiagobrauer/laravel-incremental-migrations)[ Packagist](https://packagist.org/packages/thiagobrauer/laravel-incremental-migrations)[ RSS](/packages/thiagobrauer-laravel-incremental-migrations/feed)WikiDiscussions main Synced 2d ago

READMEChangelogDependenciesVersions (2)Used By (0)

Laravel Incremental Migrations
==============================

[](#laravel-incremental-migrations)

This Laravel package extends the command `php artisan make:migration` to add an incremental number at the end of a migration file, if there is already another migration with the same name. It also has its own artisan command to fix the names of the existing migrations.

Let's say you created a migration running `php artisan make:migration alter_users_table` and then, sometime later, you need to create another migration to alter users table and you run the same command. Laravel 8 checks this problem before creating a new migration and you will get an `InvalidArgumentException`, so this package may not be useful. In Laravel &lt; 8 versions, when you run `php artisan migrate` you will get an error `Cannot declare class AlterUsersTable, because the name is already in use.`

What this package does is add an incremental number to the end of the migration file, so the classnames will never be the same. If you run `php artisan make:migration alter_users_table` multiple times, you will get `*_alter_users_table.php`, `*_alter_users_table_2.php`, `*_alter_users_table_3.php` and so on.

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

[](#installation)

```
composer require thiagobrauer/laravel-incremental-migrations

```

#### Add the Service Provider to your `config/app.php` (Laravel 5.4 and below):

[](#add-the-service-provider-to-your-configappphp-laravel-54-and-below)

```
...
ThiagoBrauer\LaravelIncrementalMigrations\IncrementalMigrationsServiceProvider

```

Usage
-----

[](#usage)

To create new migrations, just call the artisan command as usual:

```
php artisan make:migration migration_name

```

#### Fix existing migrations

[](#fix-existing-migrations)

⚠️ Not recommended for projects already running in production

```
php artisan incremental-migrations:fix

```

This command will check all the existing migrations and rename them if there are duplicated ones.

Laravel 8 now includes a ["squash"](https://laravel.com/docs/8.x/migrations#squashing-migrations) feature. Take a look at it, cause it may be an alternative to using this command.

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity32

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/b9a9949ebb16e2f92a452713cd81abb8b4dc657141eecbba5877d9fb5d7fa066?d=identicon)[thiagobrauer](/maintainers/thiagobrauer)

---

Top Contributors

[![thiagobrauer](https://avatars.githubusercontent.com/u/14283641?v=4)](https://github.com/thiagobrauer "thiagobrauer (15 commits)")

### Embed Badge

![Health badge](/badges/thiagobrauer-laravel-incremental-migrations/health.svg)

```
[![Health](https://phpackages.com/badges/thiagobrauer-laravel-incremental-migrations/health.svg)](https://phpackages.com/packages/thiagobrauer-laravel-incremental-migrations)
```

PHPackages © 2026

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