PHPackages                             pursehouse/modeler-laravel-eloquent - 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. pursehouse/modeler-laravel-eloquent

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

pursehouse/modeler-laravel-eloquent
===================================

Generate model classes for Eloquent in Laravel

v0.1.0(6y ago)112.4k↓50%4[1 issues](https://github.com/pursehouse/modeler-laravel-eloquent/issues)MITPHPPHP &gt;=5.6.4

Since Oct 16Pushed 6y agoCompare

[ Source](https://github.com/pursehouse/modeler-laravel-eloquent)[ Packagist](https://packagist.org/packages/pursehouse/modeler-laravel-eloquent)[ Docs](https://github.com/pursehouse)[ RSS](/packages/pursehouse-modeler-laravel-eloquent/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (9)Versions (16)Used By (0)

Pursehouse Modeler for Eloquent/Laravel
=======================================

[](#pursehouse-modeler-for-eloquentlaravel)

[![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)

Generate model classes for Eloquent in Laravel

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 `pursehouse/modeler-laravel-eloquent` package via composer:

```
composer config repositories.pursehouse/modeler-laravel-eloquent vcs https://github.com/pursehouse/modeler-laravel-eloquent

composer require pursehouse/modeler-laravel-eloquent:dev-master
```

### Configuration

[](#configuration)

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

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

    Pursehouse\Modeler\Coders\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 config repositories.pursehouse/modeler-laravel-eloquent vcs https://github.com/pursehouse/modeler-laravel-eloquent

composer require pursehouse/modeler-laravel-eloquent:dev-master --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(\Pursehouse\Modeler\Coders\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 and clear the config cache:

```
php artisan vendor:publish --tag=pursehouse-modeler
php artisan config:clear
```

### 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 pursehouse:modeler
```

- You can scaffold a specific table like this:

```
php artisan pursehouse:modeler --table=users
```

- You can also specify the connection:

```
php artisan pursehouse:modeler --connection=mysql
```

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

```
php artisan pursehouse:modeler --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 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 :-)

#### Origins

[](#origins)

Originally forked from `Reliese/larvel` project

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity27

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

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

Recently: every ~279 days

Total

14

Last Release

2363d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9fc44b6621b6b6f1e56fdb048f0d52b9f0c7b44f5ff347119db58da90e224c03?d=identicon)[pursehouse](/maintainers/pursehouse)

---

Top Contributors

[![CristianLlanos](https://avatars.githubusercontent.com/u/6595277?v=4)](https://github.com/CristianLlanos "CristianLlanos (53 commits)")[![gareth-ib](https://avatars.githubusercontent.com/u/29517750?v=4)](https://github.com/gareth-ib "gareth-ib (31 commits)")[![DamienBurkeJJ](https://avatars.githubusercontent.com/u/29195729?v=4)](https://github.com/DamienBurkeJJ "DamienBurkeJJ (12 commits)")[![boukeversteegh](https://avatars.githubusercontent.com/u/53926?v=4)](https://github.com/boukeversteegh "boukeversteegh (6 commits)")[![myusuf5400](https://avatars.githubusercontent.com/u/11193088?v=4)](https://github.com/myusuf5400 "myusuf5400 (5 commits)")[![anurbol](https://avatars.githubusercontent.com/u/3603448?v=4)](https://github.com/anurbol "anurbol (5 commits)")[![timhaak](https://avatars.githubusercontent.com/u/271607?v=4)](https://github.com/timhaak "timhaak (4 commits)")[![pursehouse](https://avatars.githubusercontent.com/u/3063832?v=4)](https://github.com/pursehouse "pursehouse (3 commits)")[![jefhar](https://avatars.githubusercontent.com/u/22824070?v=4)](https://github.com/jefhar "jefhar (3 commits)")[![OmarRobinson](https://avatars.githubusercontent.com/u/16844791?v=4)](https://github.com/OmarRobinson "OmarRobinson (2 commits)")[![jampot5000](https://avatars.githubusercontent.com/u/932691?v=4)](https://github.com/jampot5000 "jampot5000 (2 commits)")[![bassco](https://avatars.githubusercontent.com/u/2122685?v=4)](https://github.com/bassco "bassco (2 commits)")[![VladimirRebilly](https://avatars.githubusercontent.com/u/144002104?v=4)](https://github.com/VladimirRebilly "VladimirRebilly (1 commits)")[![angujo](https://avatars.githubusercontent.com/u/9949636?v=4)](https://github.com/angujo "angujo (1 commits)")[![delmicio](https://avatars.githubusercontent.com/u/2908209?v=4)](https://github.com/delmicio "delmicio (1 commits)")[![jaumebalust](https://avatars.githubusercontent.com/u/6225438?v=4)](https://github.com/jaumebalust "jaumebalust (1 commits)")[![Omranic](https://avatars.githubusercontent.com/u/406705?v=4)](https://github.com/Omranic "Omranic (1 commits)")[![pozhidaevak](https://avatars.githubusercontent.com/u/1496874?v=4)](https://github.com/pozhidaevak "pozhidaevak (1 commits)")[![acousticksan](https://avatars.githubusercontent.com/u/2283454?v=4)](https://github.com/acousticksan "acousticksan (1 commits)")

---

Tags

laravelmodeleloquentmodels

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/pursehouse-modeler-laravel-eloquent/health.svg)

```
[![Health](https://phpackages.com/badges/pursehouse-modeler-laravel-eloquent/health.svg)](https://phpackages.com/packages/pursehouse-modeler-laravel-eloquent)
```

###  Alternatives

[tucker-eric/eloquentfilter

An Eloquent way to filter Eloquent Models

1.8k4.8M26](/packages/tucker-eric-eloquentfilter)[dyrynda/laravel-model-uuid

This package allows you to easily work with UUIDs in your Laravel models.

4802.8M8](/packages/dyrynda-laravel-model-uuid)[clickbar/laravel-magellan

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

423715.4k1](/packages/clickbar-laravel-magellan)[reedware/laravel-relation-joins

Adds the ability to join on a relationship by name.

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

Baum is an implementation of the Nested Set pattern for Eloquent models.

3154.7k](/packages/toponepercent-baum)[aedart/athenaeum

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

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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