PHPackages                             noouh/auto-model - 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. noouh/auto-model

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

noouh/auto-model
================

A Laravel package to auto-generate models and migrations from table definitions.

v1.0.2(2y ago)113MITPHPPHP ^8.0

Since Jul 3Pushed 1y ago1 watchersCompare

[ Source](https://github.com/mohamedhekal/N-Magic-Models)[ Packagist](https://packagist.org/packages/noouh/auto-model)[ RSS](/packages/noouh-auto-model/feed)WikiDiscussions main Synced yesterday

READMEChangelog (3)Dependencies (1)Versions (4)Used By (0)

Noouh Auto Model
================

[](#noouh-auto-model)

A Laravel package to auto-generate models and migrations from table definitions.

About the Company
-----------------

[](#about-the-company)

**Noouh For Integrated Solutions** is dedicated to providing innovative software solutions. We specialize in developing high-quality applications tailored to meet the specific needs of our clients.

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

[](#installation)

To install the Noouh Auto Model package, you can require it using Composer:

```
composer require noouh/auto-model
```

Publish the Stubs
-----------------

[](#publish-the-stubs)

After installing the package, publish the stubs using the following command:

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

This will publish the `model.stub` and `migration.stub` files to your project's `stubs` directory.

Usage
-----

[](#usage)

Create a JSON file (e.g., `tables.json`) with your table definitions and relationships. Here is an example structure:

```
[
  {
    "table": "users",
    "columns": [
      { "name": "name", "type": "string" },
      { "name": "email", "type": "string" }
    ]
  },
  {
    "table": "posts",
    "columns": [
      { "name": "title", "type": "string" },
      { "name": "content", "type": "text" },
      { "name": "user_id", "type": "unsignedBigInteger" }
    ],
    "relationships": [
      { "type": "belongsTo", "relatedTable": "users", "foreignKey": "user_id" }
    ]
  }
]
```

Run the command to generate models and migrations:

```
php artisan generate:models /path/to/tables.json
```

Example
-------

[](#example)

Given the following `tables.json` file:

```
[
  {
    "table": "users",
    "columns": [
      { "name": "name", "type": "string" },
      { "name": "email", "type": "string" }
    ]
  },
  {
    "table": "posts",
    "columns": [
      { "name": "title", "type": "string" },
      { "name": "content", "type": "text" },
      { "name": "user_id", "type": "unsignedBigInteger" }
    ],
    "relationships": [
      { "type": "belongsTo", "relatedTable": "users", "foreignKey": "user_id" }
    ]
  }
]
```

Running the command:

```
php artisan generate:models /path/to/tables.json
```

Will generate:

- A `User` model in `app/Models/User.php`
- A `Post` model in `app/Models/Post.php` with a `belongsTo` relationship to the `User` model
- A migration file for the `users` table
- A migration file for the `posts` table with a foreign key to the `users` table

License
-------

[](#license)

This package is open-sourced software licensed under the [MIT license](LICENSE).

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance26

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity48

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

Total

3

Last Release

730d ago

### Community

Maintainers

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

---

Top Contributors

[![mohamedhekal](https://avatars.githubusercontent.com/u/21014387?v=4)](https://github.com/mohamedhekal "mohamedhekal (9 commits)")

### Embed Badge

![Health badge](/badges/noouh-auto-model/health.svg)

```
[![Health](https://phpackages.com/badges/noouh-auto-model/health.svg)](https://phpackages.com/packages/noouh-auto-model)
```

###  Alternatives

[illuminate/database

The Illuminate Database package.

2.8k54.9M11.6k](/packages/illuminate-database)[yajra/laravel-oci8

Oracle DB driver for Laravel via OCI8

8793.2M25](/packages/yajra-laravel-oci8)[glushkovds/phpclickhouse-laravel

Adapter of the most popular library https://github.com/smi2/phpClickHouse to Laravel

2051.5M2](/packages/glushkovds-phpclickhouse-laravel)[lemaur/eloquent-publishing

218.1k1](/packages/lemaur-eloquent-publishing)[laravel-liberu/laravel-gedcom

A package that converts gedcom files to Eloquent models

782.5k1](/packages/laravel-liberu-laravel-gedcom)

PHPackages © 2026

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