PHPackages                             developerawam/generate-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. developerawam/generate-migration

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

developerawam/generate-migration
================================

This package automatically generates migration files for your Laravel application. With this feature, you can quickly create database structures without writing SQL code manually. Simply specify the model you want to create, and this package will handle the rest, streamlining development and minimizing human errors.

v2.0.5(1y ago)6251MITCSSPHP ^8.0

Since Aug 2Pushed 1y ago1 watchersCompare

[ Source](https://github.com/developerawam/generate-migration)[ Packagist](https://packagist.org/packages/developerawam/generate-migration)[ RSS](/packages/developerawam-generate-migration/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (9)Dependencies (2)Versions (10)Used By (0)

Laravel Auto Create Model, Migration, and Table
===============================================

[](#laravel-auto-create-model-migration-and-table)

[![Latest Version on Packagist](https://camo.githubusercontent.com/7b3d5538a2a4f5a5c9c2bb8ae39f1d2df844b0b732c492775d4dcf405b9fdad6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f646576656c6f7065726177616d2f67656e65726174652d6d6967726174696f6e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/developerawam/generate-migration)[![Total Downloads](https://camo.githubusercontent.com/4693d06d0537c55b967ecde6d24519fcbcbe6e495f34144cfad469a5549587fb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f646576656c6f7065726177616d2f67656e65726174652d6d6967726174696f6e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/developerawam/generate-migration)

This package automatically create and generate migration files for your Laravel application. With this feature, you can quickly create database structures without writing SQL code manually. Simply specify the model you want to create, and this package will handle the rest, streamlining development and minimizing human errors.

Requirements
------------

[](#requirements)

- Laravel 11
- PHP ^8.0
- TailwindCSS ^3.4

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

[](#installation)

You can install the package via composer:

```
composer require developerawam/generate-migration
```

### Publish the Assets

[](#publish-the-assets)

Run the following Artisan command to publish the assets to your Laravel application's public directory:

```
php artisan vendor:publish --tag=assets
```

Usage
-----

[](#usage)

After installation, you can access the user interface to auto create generate models, migrations, and tables by visiting the following URL in your browser:

```
/generate-migration/generate-ui
```

This screenshot showcases the user interface provided by the package. The interface allows users to easily generate models, migrations, and database tables in a Laravel project through a simple and intuitive UI.

[![UI Screenshot](https://camo.githubusercontent.com/279f9185326fc96c98474389dd9134c0015f147ff48453490948c6db6d9b4525/68747470733a2f2f692e6962622e636f2e636f6d2f3432365344626e2f53637265656e73686f742d323032342d30382d31332d3038323733312e706e67)](https://camo.githubusercontent.com/279f9185326fc96c98474389dd9134c0015f147ff48453490948c6db6d9b4525/68747470733a2f2f692e6962622e636f2e636f6d2f3432365344626e2f53637265656e73686f742d323032342d30382d31332d3038323733312e706e67)

Use the `GenerateMigration` class to create a migration with the desired table name and columns. The example code below demonstrates how to create a migration for a `post` table with columns:

```
    use Developerawam\GenerateMigration\GenerateMigration;

    // table name example
    $table_name = "post";

    // table column example
    $table_colom = [
        [
            "name"      => "name",
            "type"      => "string",
            "default"   => null
        ],
        [
            "name"      => "description",
            "type"      => "text",
            "default"   => null
        ],
        [
            "name"      => "age",
            "type"      => "integer",
            "default"   => 20
        ],
        [
            "name"      => "views",
            "type"      => "bigInteger",
            "default"   => 0
        ],
        [
            "name"      => "price",
            "type"      => "decimal",
            "precision" => 8,
            "scale"     => 2,
            "default"   => 0.00
        ],
        [
            "name"      => "rating",
            "type"      => "float",
            "precision" => 8,
            "scale"     => 2,
            "default"   => 0.00
        ],
        [
            "name"      => "birthdate",
            "type"      => "date",
            "default"   => "2000-01-01"
        ],
        [
            "name"      => "appointment_time",
            "type"      => "time",
            "default"   => "12:00:00"
        ],
        [
            "name"      => "created_at",
            "type"      => "timestamp",
            "default"   => "CURRENT_TIMESTAMP"
        ],
        [
            "name"      => "is_active",
            "type"      => "boolean",
            "default"   => true
        ],
        [
            "name"      => "status",
            "type"      => "enum",
            "values"    => ["pending", "approved", "rejected"],
            "default"   => "pending"
        ],
        [
            "name"      => "settings",
            "type"      => "json",
            "default"   => "{\"theme\": \"dark\", \"notifications\": true}"
        ]
    ];

    // table_name must be string
    // table_column must be array object
    GenerateMigration::create($table_name, $table_colom);
```

### Code Explanation

[](#code-explanation)

- $table\_name: The name of the table you want to create, in this case, post.
- $table\_columns: An array of columns to be created in the table. Each column is an array containing the column name (name) and data type (type).
- GenerateMigration::create($table\_name, $table\_columns): Calls the create method from the GenerateMigration class to create a migration based on the specified table name and columns.

### Testing

[](#testing)

```
composer test
```

Laravel Package Boilerplate
---------------------------

[](#laravel-package-boilerplate)

This package was generated using the [Laravel Package Boilerplate](https://laravelpackageboilerplate.com).

Support the Project
-------------------

[](#support-the-project)

If you find this project useful and would like to support its development, you can make a donation:

- [Buy Me a Coffee](https://trakteer.id/developer_awam/link)

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community5

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

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 ~1 days

Total

9

Last Release

642d ago

Major Versions

1.0.2 → v2.0.02024-08-13

### Community

Maintainers

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

---

Tags

developerawamgenerate-migration

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/developerawam-generate-migration/health.svg)

```
[![Health](https://phpackages.com/badges/developerawam-generate-migration/health.svg)](https://phpackages.com/packages/developerawam-generate-migration)
```

###  Alternatives

[doctrine/orm

Object-Relational-Mapper for PHP

10.2k285.3M6.2k](/packages/doctrine-orm)[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k115.1M102](/packages/jdorn-sql-formatter)[illuminate/database

The Illuminate Database package.

2.8k52.4M9.4k](/packages/illuminate-database)[mongodb/mongodb

MongoDB driver library

1.6k64.0M546](/packages/mongodb-mongodb)[ramsey/uuid-doctrine

Use ramsey/uuid as a Doctrine field type.

90340.3M211](/packages/ramsey-uuid-doctrine)[reliese/laravel

Reliese Components for Laravel Framework code generation.

1.7k3.4M16](/packages/reliese-laravel)

PHPackages © 2026

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