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(1y 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 1mo ago

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

25

—

LowBetter than 37% of packages

Maintenance32

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity47

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

682d 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.8k52.4M9.4k](/packages/illuminate-database)[cybercog/laravel-love

Make Laravel Eloquent models reactable with any type of emotions in a minutes!

1.2k302.7k1](/packages/cybercog-laravel-love)[cviebrock/eloquent-taggable

Easy ability to tag your Eloquent models in Laravel.

567694.8k3](/packages/cviebrock-eloquent-taggable)[clickbar/laravel-magellan

This package provides functionality for working with the postgis extension in Laravel.

423715.4k1](/packages/clickbar-laravel-magellan)[genealabs/laravel-pivot-events

This package introduces new eloquent events for sync(), attach(), detach() or updateExistingPivot() methods on BelongsToMany relation.

1404.9M8](/packages/genealabs-laravel-pivot-events)[reedware/laravel-relation-joins

Adds the ability to join on a relationship by name.

2121.2M13](/packages/reedware-laravel-relation-joins)

PHPackages © 2026

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