PHPackages                             shishao/laramodel - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. shishao/laramodel

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

shishao/laramodel
=================

laravel框架中，用于创建mdel的扩展包,简单、轻量级

1.0(8y ago)034MITPHPPHP &gt;=5.6.4

Since Oct 24Pushed 8y ago1 watchersCompare

[ Source](https://github.com/shishaoqi/Laramodel)[ Packagist](https://packagist.org/packages/shishao/laramodel)[ RSS](/packages/shishao-laramodel/feed)WikiDiscussions master Synced today

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

Laravel Auto create model
=========================

[](#laravel-auto-create-model)

[![StyleCI](https://camo.githubusercontent.com/6fb04b1c5d06d8940e265177240b68d3685d4ce477f105504de12d1ea6d20344/68747470733a2f2f7374796c6563692e696f2f7265706f732f37313038303530382f736869656c643f7374796c653d666c6174)](https://styleci.io/repos/71080508)[![Build Status](https://camo.githubusercontent.com/1be14c576ef96d9b9e9041f911278bead64119f7c9419d727f008ab85741aef9/68747470733a2f2f7472617669732d63692e6f72672f72656c696573652f6c61726176656c2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/reliese/laravel)[![Latest Stable Version](https://camo.githubusercontent.com/05be75ec4f99883c7b3f3ee3a758bdd3d84dfb70405c8f36b6b0ea12b8935b0b/68747470733a2f2f706f7365722e707567782e6f72672f72656c696573652f6c61726176656c2f762f737461626c65)](https://packagist.org/packages/reliese/laravel)[![Total Downloads](https://camo.githubusercontent.com/c045dfff165ea5931b5ff1e5ef627e6e31106b8405817db47f2fb841901f6647/68747470733a2f2f706f7365722e707567782e6f72672f72656c696573652f6c61726176656c2f646f776e6c6f616473)](https://packagist.org/packages/reliese/laravel)[![Latest Unstable Version](https://camo.githubusercontent.com/2670289b91ab231bc48f22cec813d18f8c296873863fb55502393a6dc67d40c2/68747470733a2f2f706f7365722e707567782e6f72672f72656c696573652f6c61726176656c2f762f756e737461626c65)](https://packagist.org/packages/reliese/laravel)[![License](https://camo.githubusercontent.com/2fb2c31077f7f24dd8234fd0e8820625bbd9791d972afadbc1cd02a123dd5b69/68747470733a2f2f706f7365722e707567782e6f72672f72656c696573652f6c61726176656c2f6c6963656e7365)](https://packagist.org/packages/reliese/laravel)

laramodel is a collection of Laravel Components which aim is to help the development process of Laravel applications by providing some convenient code-generation capabilities.

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

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

This package expects that you are using Laravel 5.1 or above. You will need to import the `reliese/laravel` package via composer:

```
composer require reliese/laravel
```

### Configuration

[](#configuration)

Add the service provider to your `config/app.php` file within the `providers` key:

```
// ...
'providers' => [
    /*
     * Package Service Providers...
     */

    shishao\laramodel\CodersServiceProvider::class,
],
// ...
```

### Configuration for local environment only

[](#configuration-for-local-environment-only)

If you wish to enable generators only for your local environment, you should install it via composer using the --dev option like this:

```
composer require reliese/laravel --dev
```

Then you'll need to register the provider in `app/Providers/AppServiceProvider.php` file.

```
public function register()
{
    if ($this->app->environment() == 'local') {
        $this->app->register(\shishao\laramodel\CodersServiceProvider::class);
    }
}
```

Models
------

[](#models)

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

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

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

### 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/reliese/laravel/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 you 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 to 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 only supports MySQL databases. Support for other databases will be added soon.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

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

3119d ago

### Community

Maintainers

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

### Embed Badge

![Health badge](/badges/shishao-laramodel/health.svg)

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

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M683](/packages/barryvdh-laravel-ide-helper)[orchestra/canvas

Code Generators for Laravel Applications and Packages

21017.2M157](/packages/orchestra-canvas)[spatie/laravel-enum

Laravel Enum support

3655.4M31](/packages/spatie-laravel-enum)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[illuminate/queue

The Illuminate Queue package.

20331.4M1.2k](/packages/illuminate-queue)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

255.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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