PHPackages                             tinymeng/laravel-generation-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. [Framework](/categories/framework)
4. /
5. tinymeng/laravel-generation-model

ActiveLibrary[Framework](/categories/framework)

tinymeng/laravel-generation-model
=================================

tinymeng Components for Laravel Framework code generation.

v1.0.0(4y ago)129MITPHPPHP ^7.3|^8.0

Since Mar 4Pushed 4y ago1 watchersCompare

[ Source](https://github.com/majiameng/laravel-generation-model)[ Packagist](https://packagist.org/packages/tinymeng/laravel-generation-model)[ Docs](http://majiameng.com)[ RSS](/packages/tinymeng-laravel-generation-model/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (9)Versions (2)Used By (0)

tinymeng Laravel Model Generator
================================

[](#tinymeng-laravel-model-generator)

[![Build Status](https://camo.githubusercontent.com/fc4c3566390d23c646ad06f08df7e2a015b782e419f244f0361067c22922c07f/68747470733a2f2f7472617669732d63692e6f72672f6d616a69616d656e672f6c61726176656c2d67656e65726174696f6e2d6d6f64656c2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/majiameng/laravel-generation-model)[![Latest Stable Version](https://camo.githubusercontent.com/2dffd5029c486f922d2c9e4f65715194f1f952fe2e92aae4cc442dfca07dbac2/68747470733a2f2f706f7365722e707567782e6f72672f6c61726176656c2d67656e65726174696f6e2d6d6f64656c2f6c61726176656c2f762f737461626c65)](https://packagist.org/packages/majiameng/laravel-generation-model)[![Total Downloads](https://camo.githubusercontent.com/893ce994515e536c43d6869306ec615e1d514751227455bd81e74495e46ae42c/68747470733a2f2f706f7365722e707567782e6f72672f6d616a69616d656e672f6c61726176656c2d67656e65726174696f6e2d6d6f64656c2f646f776e6c6f616473)](https://packagist.org/packages/majiameng/laravel-generation-model)[![Latest Unstable Version](https://camo.githubusercontent.com/860320f2de8a709b43dfb5044a8860d5c700400e889b38b926f18c3100bb3882/68747470733a2f2f706f7365722e707567782e6f72672f6d616a69616d656e672f6c61726176656c2d67656e65726174696f6e2d6d6f64656c2f762f756e737461626c65)](https://packagist.org/packages/majiameng/laravel-generation-model)[![License](https://camo.githubusercontent.com/44546b5e109bde0747f6e73fb4b6b27c049a43c77e143343db3ca9e63e1d3409/68747470733a2f2f706f7365722e707567782e6f72672f6d616a69616d656e672f6c61726176656c2d67656e65726174696f6e2d6d6f64656c2f6c6963656e7365)](https://packagist.org/packages/majiameng/laravel-generation-model)

tinymeng Laravel Model Generator aims to speed up the development process of Laravel applications by providing some convenient code-generation capabilities. The tool inspects your database structure, including column names and foreign keys, in order to automatically generate Models that have correctly typed properties, along with any relationships to other Models.

How does it work?
-----------------

[](#how-does-it-work)

This package expects that you are using laravel-generation-model 5.1 or above. You will need to import the `tinymeng/laravel-generation-model` package via composer:

### Configuration

[](#configuration)

It is recommended that this package should only be used on a local environment for security reasons. You should install it via composer using the --dev option like this:

```
composer require tinymeng/laravel-generation-model --dev
```

Add the `models.php` configuration file to your `config` directory and clear the config cache:

```
php artisan vendor:publish --tag=tinymeng-models

# Let's refresh our config cache just in case
php artisan config:clear
```

Models
------

[](#models)

[![Generating models with artisan](https://camo.githubusercontent.com/8af580d8f73d315bdc934e57daa3356827ca0175678bddaa35b13e5411f3b5da/68747470733a2f2f63646e2d696d616765732d312e6d656469756d2e636f6d2f6d61782f3830302f312a684f613251784f5245327a794f5f2d5a714a343073412e706e67 "Making artisan code my Eloquent models")](https://camo.githubusercontent.com/8af580d8f73d315bdc934e57daa3356827ca0175678bddaa35b13e5411f3b5da/68747470733a2f2f63646e2d696d616765732d312e6d656469756d2e636f6d2f6d61782f3830302f312a684f613251784f5245327a794f5f2d5a714a343073412e706e67)

### Usage

[](#usage)

Assuming you have already configured your database, you are now all set to go.

- Let's scaffold some of your models from your default connection.

```
php artisan code:models
```

- You can scaffold a specific table like this:

```
php artisan code:models --table=users
```

- You can also specify the connection:

```
php artisan code:models --connection=mysql
```

- If you are using a MySQL database, you can specify which schema you want to scaffold:

```
php artisan code:models --schema=shop
```

### Customizing Model Scaffolding

[](#customizing-model-scaffolding)

To change the scaffolding behaviour you can make `config/models.php` configuration file fit your database needs. [Check it out](https://github.com/tinymeng/laravel-generation-model/blob/master/config/models.php) ;-)

### Tips

[](#tips)

#### 1. Keeping model changes

[](#1-keeping-model-changes)

You may want to generate your models as often as you change your database. In order not to lose your own model changes, you should set `base_files` to `true` in your `config/models.php`.

When you enable this feature your models will inherit their base configurations from base models. You should avoid adding code to your base models, since you will lose all changes when they are generated again.

> Note: You will end up with two models for the same table and you may think it is a horrible idea to have two classes for the same thing. However, it is up to you to decide whether this approach gives value to your project :-)

#### Support

[](#support)

For the time being, this package supports MySQL, PostgreSQL and SQLite databases. Support for other databases are encouraged to be added through pull requests.

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity54

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

Unknown

Total

1

Last Release

1582d ago

### Community

Maintainers

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

---

Top Contributors

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

---

Tags

laraveltinymeng

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/tinymeng-laravel-generation-model/health.svg)

```
[![Health](https://phpackages.com/badges/tinymeng-laravel-generation-model/health.svg)](https://phpackages.com/packages/tinymeng-laravel-generation-model)
```

###  Alternatives

[laravel/ai

The official AI SDK for Laravel.

1.0k3.2M193](/packages/laravel-ai)[illuminate/queue

The Illuminate Queue package.

21332.6M1.6k](/packages/illuminate-queue)[laravel/cashier

Laravel Cashier provides an expressive, fluent interface to Stripe's subscription billing services.

2.6k29.9M145](/packages/laravel-cashier)[laravel/sail

Docker files for running a basic Laravel application.

1.9k205.7M1.3k](/packages/laravel-sail)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k15.1M130](/packages/laravel-pulse)[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)

PHPackages © 2026

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