PHPackages                             laracademy/model-generator - 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. laracademy/model-generator

Abandoned → [laracademy/generators](/?search=laracademy%2Fgenerators)Library[Database &amp; ORM](/categories/database)

laracademy/model-generator
==========================

This package will generate a Laravel Model based on your database table itself, filling in the required fields automatically.

1.2(9y ago)6710.4k↑16.7%5[1 issues](https://github.com/laracademy/ModelGenerator/issues)MITPHP

Since May 18Pushed 9y ago5 watchersCompare

[ Source](https://github.com/laracademy/ModelGenerator)[ Packagist](https://packagist.org/packages/laracademy/model-generator)[ RSS](/packages/laracademy-model-generator/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)DependenciesVersions (4)Used By (0)

Model Generator
===============

[](#model-generator)

[![Latest Stable Version](https://camo.githubusercontent.com/672f5cabedcbcfc30ede3b1a7e0fda016d5d479d3f519f5b1f209e7776f4038e/68747470733a2f2f706f7365722e707567782e6f72672f6c617261636164656d792f6d6f64656c2d67656e657261746f722f762f737461626c65)](https://packagist.org/packages/laracademy/model-generator) [![Total Downloads](https://camo.githubusercontent.com/7afb3bb7ae0932d798ac5779321a58d7f3fec20fd8aa41982cff5b2dd90be826/68747470733a2f2f706f7365722e707567782e6f72672f6c617261636164656d792f6d6f64656c2d67656e657261746f722f646f776e6c6f616473)](https://packagist.org/packages/laracademy/model-generator) [![Latest Unstable Version](https://camo.githubusercontent.com/1849f435abc0704849cd4e451cb77dae18fa33dfbe3a9b29d0b66d7ab15fadc9/68747470733a2f2f706f7365722e707567782e6f72672f6c617261636164656d792f6d6f64656c2d67656e657261746f722f762f756e737461626c65)](https://packagist.org/packages/laracademy/model-generator) [![License](https://camo.githubusercontent.com/5a87f2e3606bdde7b54870ab14aec6c7485e79f12b19a2abb9f3b781346bfb4f/68747470733a2f2f706f7365722e707567782e6f72672f6c617261636164656d792f6d6f64656c2d67656e657261746f722f6c6963656e7365)](https://packagist.org/packages/laracademy/model-generator)

PLEASE NOTE THAT THIS PACKAGE IS NOW MOVED INTO
======================================================================================================

[](#please-note-that-this-package-is-now-moved-into-httpspackagistorgpackageslaracademygenerators)

**Model Generator** - Will read your current table structure and generate a model will the filled in fields automatically.

You can generate a single table model, or multiple at once.

**Author(s):**

- [Laracademy](https://laracademy.co) ([@laracademy](http://twitter.com/laracademy), )

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

[](#requirements)

1. PHP 5.6+
2. Laravel 5.2+

Usage
-----

[](#usage)

### Step 1: Install through Composer

[](#step-1-install-through-composer)

```
composer require "laracademy/model-generator"

```

### Step 2: Add the Service Provider

[](#step-2-add-the-service-provider)

The easiest method is to add the following into your `config/app.php` file

```
Laracademy\ModelGenerator\ModelGeneratorServiceProvider::class
```

Depending on your set up you may want to only use these providers for development, so you don't update your `production` servers. Instead, add the provider in `app/Providers/AppServiceProvider.php' like so

```
public function register()
{
    if($this->app->environment() == 'local') {
        $this->app->register('\Laracademy\ModelGenerator\ModelGeneratorServiceProvider');
    }
}
```

### Artisan

[](#artisan)

Now that we have added the generator to our project the last thing to do is run Laravel's Arisan command

```
php artisan

```

You will see the following in the list

```
generate:model

```

The command comes with a bunch of different options and they are listed below

- --table=
- this can either be a single table, or a list of tables separated by a comma
- --all
- this will ignore any tables that you have added and generate a full list of tables within your database to generate models for
- please note that this command will only ignore the `migrations` table and no model will be generate for it
- --connection=
-
- --debug
- this shows some more information while running

Examples
--------

[](#examples)

### Generating a single table

[](#generating-a-single-table)

```
php artisan generate:model --table=users

```

### Generating a multiple tables

[](#generating-a-multiple-tables)

```
php artisan generate:model --table=users,posts

```

### Generating all tables

[](#generating-all-tables)

```
php artisan generate:model --all

```

### Changing to another connection found in `database.php` and generating models for all tables

[](#changing-to-another-connection-found-in-databasephp-and-generating-models-for-all-tables)

```
php artisan generate:model --connection=spark --all

```

License
-------

[](#license)

ModelGen is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT)

### Bug Reporting and Feature Requests

[](#bug-reporting-and-feature-requests)

Please add as many details as possible regarding submission of issues and feature requests

### Disclaimer

[](#disclaimer)

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity36

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity65

Established project with proven stability

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

Total

3

Last Release

3637d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4c554112713a408512e3c5986a02d598f235daa4e6683c52b0b2ec873e6cb175?d=identicon)[Laracademy](/maintainers/Laracademy)

---

Top Contributors

[![danrovito](https://avatars.githubusercontent.com/u/8322674?v=4)](https://github.com/danrovito "danrovito (2 commits)")

---

Tags

laravelgenerators

### Embed Badge

![Health badge](/badges/laracademy-model-generator/health.svg)

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

###  Alternatives

[orangehill/iseed

Generate a new Laravel database seed file based on data from the existing database table.

2.9k9.2M55](/packages/orangehill-iseed)[rtconner/laravel-likeable

Trait for Laravel Eloquent models to allow easy implementation of a 'like' or 'favorite' or 'remember' feature.

394388.0k5](/packages/rtconner-laravel-likeable)[cheesegrits/iseed

This is a fork of the SchuBu/iseed of the original package Orangehill/Iseed. Generate a new Laravel database seed file based on data from the existing database table.

105.8k](/packages/cheesegrits-iseed)[cubettech/lacassa

Cassandra based query builder for laravel.

358.5k](/packages/cubettech-lacassa)[phaza/single-table-inheritance

Single Table Inheritance Trait

1515.8k](/packages/phaza-single-table-inheritance)

PHPackages © 2026

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