PHPackages                             mybizna/lucid - 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. mybizna/lucid

Abandoned → [mybizna/automigrator](/?search=mybizna%2Fautomigrator)Library[Database &amp; ORM](/categories/database)

mybizna/lucid
=============

Declare database migrations and factory definitions inside Laravel models.

2025.4(1y ago)3219MITPHPPHP &gt;=8.0

Since Mar 14Pushed 1y agoCompare

[ Source](https://github.com/mybizna/automigrator)[ Packagist](https://packagist.org/packages/mybizna/lucid)[ RSS](/packages/mybizna-lucid/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (5)Versions (177)Used By (0)

Automigrator
============

[](#automigrator)

This package allows you to declare database migrations and factory definitions inside of your Laravel models.

Running the `automigrator:migrate` command will automatically apply any changes you've made inside your `migration` methods to the database via Doctrine DBAL. If using the `HasNewFactory` trait and `definition` method, it will use the returned array inside the `definition` method to seed with when using the `-s` option.

The `automigrator:migrate` command will also run your file-based (traditional) Laravel migrations first, and then your model method migrations after. If you need your model-based migrations to run in a specific order, you may add a `$migrationOrder` property to your models with an integer value (default is `0`).

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

[](#installation)

Require this package via Composer:

```
composer require mybizna/automigrator
```

Usage
-----

[](#usage)

Use the `HasNewFactory` trait, and declare `migration` and `definition` methods in your models:

```
use Faker\Generator;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Schema\Blueprint;
use Mybizna\Automigrator\Traits\HasNewFactory;

class MyModel extends Model
{
    use HasNewFactory;

    protected $guarded = [];
    protected $migrationOrder = 1; // optional

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

    public function definition(Generator $faker)
    {
        return [
            'name' => $faker->name(),
            'created_at' => $faker->dateTimeThisMonth(),
        ];
    }
}
```

Commands
--------

[](#commands)

### Migrating

[](#migrating)

Apply the changes inside your `migration` methods to your database:

```
php artisan automigrator:migrate {--f|--fresh} {--s|--seed}
```

Use the `-f` option for fresh migrations, and/or the `-s` option to run seeders afterwards.

### Making Models

[](#making-models)

Create a model containing the `migration` and `definition` methods:

```
php artisan automigrator:model {name} {--r|--resource}
```

Use the `-r` option to create a Laravel Nova resource for the model at the same time.

### Making Nova Resources

[](#making-nova-resources)

Create a Laravel Nova resource without all the comments:

```
php artisan automigrator:resource {name} {--m|--model}
```

Use the `-m` option to create a model for the Nova resource at the same time.

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance42

Moderate activity, may be stable

Popularity14

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity73

Established project with proven stability

 Bus Factor1

Top contributor holds 95.8% 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 ~6 days

Recently: every ~88 days

Total

175

Last Release

479d ago

Major Versions

1.3.58 → 23.06.02023-06-07

23.12.001 → 24.02.0012024-01-31

24.2.002 → 2025.12025-01-14

### Community

Maintainers

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

---

Top Contributors

[![dedanirungu](https://avatars.githubusercontent.com/u/1658098?v=4)](https://github.com/dedanirungu "dedanirungu (227 commits)")[![legodion](https://avatars.githubusercontent.com/u/101474500?v=4)](https://github.com/legodion "legodion (10 commits)")

---

Tags

automigrateautomigratorerplaravellaravel-frameworklaravel-modularmybiznaphplaravelfactorydatabaseeloquentmigrationsmodelsdefinitions

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mybizna-lucid/health.svg)

```
[![Health](https://phpackages.com/badges/mybizna-lucid/health.svg)](https://phpackages.com/packages/mybizna-lucid)
```

###  Alternatives

[spiritix/lada-cache

A Redis based, automated and scalable database caching layer for Laravel

591444.8k2](/packages/spiritix-lada-cache)[umbrellio/laravel-pg-extensions

Extensions for Postgres Laravel

102426.5k1](/packages/umbrellio-laravel-pg-extensions)[wayofdev/laravel-cycle-orm-adapter

🔥 A Laravel adapter for CycleORM, providing seamless integration of the Cycle DataMapper ORM for advanced database handling and object mapping in PHP applications.

3516.7k3](/packages/wayofdev-laravel-cycle-orm-adapter)[waad/laravel-model-metadata

A robust Laravel package for handling metadata with JSON casting, custom relation names, and advanced querying capabilities.

823.1k](/packages/waad-laravel-model-metadata)[jrsaunders/shard-matrix

A Complete Database Sharding system for MYSQL and/or Postgres. Using Laravels Query Builder easily scale up your application. Configure your whole solution in one Yaml Config file.

271.5k](/packages/jrsaunders-shard-matrix)

PHPackages © 2026

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