Support the ongoing development of Laravel.io →
Packages Database Eloquent

https://github.com/bastinald/laravel-automatic-migrations

Laravel Automatic Migrations

Automatic migrations for your Laravel models.

Installation

composer require bastinald/laravel-automatic-migrations

Usage

Declare a migration method in your Laravel models:

public function migration(Blueprint $table)
{
    $table->id();
    $table->string('name');
    $table->timestamp('created_at')->nullable();
    $table->timestamp('updated_at')->nullable();
}

Run the migrate:auto command:

php artisan migrate:auto

Commands

Make a model with a migration method included:

php artisan make:amodel {name}

Make a factory whose definition points to a model:

php artisan make:afactory {name}

Run automatic migrations:

php artisan migrate:auto {--fresh} {--seed} {--force}
Last updated 3 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

bastinald bastinald Joined 27 Apr 2021

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.