redbastie/laravel-auto-migrate

Automatic migrations for your Laravel models.

Installs: 13

Dependents: 0

Suggesters: 0

Security: 0

Stars: 5

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/redbastie/laravel-auto-migrate

1.0.0 2021-01-18 12:38 UTC

This package is auto-updated.

Last update: 2025-09-29 03:05:46 UTC


README

This package is no longer maintained. Please consider my latest package here: https://github.com/redbastie/tailwire

Laravel Auto Migrate

Automatic migrations for your Laravel models.

Installation

Install via composer:

composer require redbastie/laravel-auto-migrate

How It Works

The migrate:auto command will automatically diff your database and apply the necessary changes via Doctrine.

Usage

Specify a migration method in your Laravel model:

class Vehicle extends Model
{
    use HasFactory, FillsColumns;

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

Run the migrate:auto command:

php artisan migrate:auto --fresh --seed

Note that --fresh and --seed are optional.

Traditional Migrations

The migrate:auto command will run your traditional migration files before the automatic migration methods.