PHPackages                             rishpandey/laravel-auto-migration - 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. rishpandey/laravel-auto-migration

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

rishpandey/laravel-auto-migration
=================================

The package uses Doctrine DBAL in order to diff the existing tables with given model and make the necessary changes to it. If the table does not exist, it will create it.

01PHP

Since Oct 14Pushed 5y ago1 watchersCompare

[ Source](https://github.com/rishpandey/laravel-auto-migration)[ Packagist](https://packagist.org/packages/rishpandey/laravel-auto-migration)[ RSS](/packages/rishpandey-laravel-auto-migration/feed)WikiDiscussions main Synced 3w ago

READMEChangelogDependenciesVersions (2)Used By (0)

Laravel Automatic Migrations
============================

[](#laravel-automatic-migrations)

All credits to Kevin Dion, as this was initially a part of [swift](https://github.com/redbastie/swift).

### Installation

[](#installation)

```
composer require rishpandey/laravel-auto-migration

```

### Usage

[](#usage)

In order to use automatic migrations, simply specify a `migration` method in your model:

```
class Lead extends Model
{

    public function migration(Blueprint $table)
    {
        $table->id();
        $table->string('name');
        $table->timestamps();
    }

```

Now run the automatic migration command:

```
php artisan migrate:auto

```

The package uses Doctrine DBAL in order to diff the existing model table and make the necessary changes to it. If the table does not exist, it will create it.

By default the package looks under "App\\Models" for your models, but you can pass a `--base` to specify that models exists under "App":

```
php artisan migrate:auto --base

```

You can also pass `--fresh` and/or `--seed` to the `migrate:auto` command in order to get fresh migrations and/or run your seeders afterwards:

```
php artisan migrate:auto --fresh --seed

```

If your app contains traditional migrations in the `database/migrations` folder, they will be handled before the automatic migrations.

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity1

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity34

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://avatars.githubusercontent.com/u/9201847?v=4)[Rishabh Pandey](/maintainers/rishpandey)[@rishpandey](https://github.com/rishpandey)

---

Top Contributors

[![rishpandey](https://avatars.githubusercontent.com/u/9201847?v=4)](https://github.com/rishpandey "rishpandey (1 commits)")

### Embed Badge

![Health badge](/badges/rishpandey-laravel-auto-migration/health.svg)

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

###  Alternatives

[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k117.2M118](/packages/jdorn-sql-formatter)[propel/propel1

Propel is an open-source Object-Relational Mapping (ORM) for PHP5.

8351.6M87](/packages/propel-propel1)[pgvector/pgvector

pgvector support for PHP

198741.5k12](/packages/pgvector-pgvector)[jfelder/oracledb

Oracle DB driver for Laravel

11518.4k](/packages/jfelder-oracledb)

PHPackages © 2026

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