PHPackages                             cedric-lekene/laravel-migration-ai - 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. cedric-lekene/laravel-migration-ai

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

cedric-lekene/laravel-migration-ai
==================================

A Laravel package that uses AI to generate database migrations from plain-language descriptions, simplifying the migration creation process

1.1.0(1y ago)513[1 issues](https://github.com/LekeneCedric/laravel-migration-ai/issues)MITPHPPHP ^8.2

Since Dec 1Pushed 1y ago1 watchersCompare

[ Source](https://github.com/LekeneCedric/laravel-migration-ai)[ Packagist](https://packagist.org/packages/cedric-lekene/laravel-migration-ai)[ RSS](/packages/cedric-lekene-laravel-migration-ai/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (4)Versions (4)Used By (0)

🤖 Laravel Migration AI
======================

[](#-laravel-migration-ai)

A Laravel package that uses AI to generate database migrations from plain-language descriptions, simplifying the migration creation process.

[![Demo GIF](./demo/demo.gif)](./demo/demo.gif)

Table of Contents
-----------------

[](#table-of-contents)

- [Installation](#installation)
- [Configuration](#configuration)
- [Usage](#usage)
- [Commands](#commands)
- [Example](#Exemple)
- [License](#license)
- [Contributing](#contributing)

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

[](#installation)

1. **Install the package via Composer:**

    Run the following command in your Laravel project:

    ```
    composer require --dev cedric-lekene/laravel-migration-ai
    ```
2. **Register the Service Provider (if not using auto-discovery):**

    If your Laravel version does not support package auto-discovery, you will need to register the service provider in your `config/app.php` file:

    ```
    'providers' => [
        // Other Service Providers

        CedricLekene\\LaravelMigrationAI\\LaravelMigrationAIServiceProvider::class,
    ],
    ```

Configuration
-------------

[](#configuration)

To use the package, you need to set up your environment variables. Add the following keys to your `.env` file:

```
GEMINI_API_KEY=your_gemini_api_key
GEMINI_MODEL=gemini-1.5-flash

```

### Environment Variables

[](#environment-variables)

- **GEMINI\_API\_KEY**: Your API key for [Gemini](https://ai.google.dev/gemini-api/docs/api-key).
- **GEMINI\_MODEL**: (Optional) Specify the model used for Gemini (default: `gemini-1.5-flash`).

> **Note:** `GEMINI_API_KEY` must be defined in your environment variables.

Usage
-----

[](#usage)

Once the package is installed and configured, you can generate a migration file using the command below.

Commands
--------

[](#commands)

- **make:migration-ai**: Generate a migration file from a plain-language description.

### Example Command

[](#example-command)

```
php artisan make:migration-ai migration_name description="description about the content of migration"
```

### Example

[](#example)

```
php artisan make:migration-ai add_fields_in_users_table description=" Add a new column named 'age'(integer|nullable|default value 0) , 'sexe'(string|nullable), 'phone'(string|nullable)"
```

### Real Output

[](#real-output)

This command will create a migration file similar to the following:

```
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::table('users', function (Blueprint $table) {
            $table->integer('age')->nullable()->default(0);
            $table->string('sexe')->nullable();
            $table->string('phone')->nullable();

        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::table('users', function (Blueprint $table) {
            $table->dropColumn('age');
            $table->dropColumn('sexe');
            $table->dropColumn('phone');

        });
    }
}
```

This command will create a migration file based on the provided description.

License
-------

[](#license)

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

Contributing
------------

[](#contributing)

Contributions are welcome! Please read the [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to contribute to this project.

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 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.

###  Release Activity

Cadence

Every ~54 days

Total

2

Last Release

473d ago

### Community

Maintainers

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

---

Top Contributors

[![LekeneCedric](https://avatars.githubusercontent.com/u/93648451?v=4)](https://github.com/LekeneCedric "LekeneCedric (8 commits)")

---

Tags

aicomand-linecomposerdatabasegeminilaravelmigrationphplaravelmigrationdatabaseai

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/cedric-lekene-laravel-migration-ai/health.svg)

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

###  Alternatives

[dragon-code/laravel-deploy-operations

Performing any actions during the deployment process

240173.5k2](/packages/dragon-code-laravel-deploy-operations)[cybercog/laravel-clickhouse

ClickHouse migrations for Laravel

163166.8k](/packages/cybercog-laravel-clickhouse)[awssat/laravel-sync-migration

Laravel tool helps to sync migrations without refreshing the database

10923.2k](/packages/awssat-laravel-sync-migration)[maxim-oleinik/blade-migrations-laravel

An intelligent alternative version of Laravel Database Migrations - uses raw-sql syntax, transactions, auto-rollback, UP-DOWN-UP testing

242.3k](/packages/maxim-oleinik-blade-migrations-laravel)[codengine/laravel-custom-migrations

Custom Migrations for Laravel

131.3k](/packages/codengine-laravel-custom-migrations)

PHPackages © 2026

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