PHPackages                             rossity/laravel-modelgenerator - 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. [API Development](/categories/api)
4. /
5. rossity/laravel-modelgenerator

AbandonedArchivedLibrary[API Development](/categories/api)

rossity/laravel-modelgenerator
==============================

Easily scaffold API models

1.1.9(7y ago)034[7 issues](https://github.com/rossity/laravel-modelgenerator/issues)MITPHPPHP ^7.1

Since Jul 30Pushed 7y agoCompare

[ Source](https://github.com/rossity/laravel-modelgenerator)[ Packagist](https://packagist.org/packages/rossity/laravel-modelgenerator)[ RSS](/packages/rossity-laravel-modelgenerator/feed)WikiDiscussions master Synced yesterday

READMEChangelog (10)Dependencies (4)Versions (13)Used By (0)

laravel-modelgenerator
======================

[](#laravel-modelgenerator)

Easily scaffold an API model.

This is highly specific to my own use-cases and projects.

Commands
--------

[](#commands)

`php artisan generate:template {model}`

- Generates a template to `App\Http\Templates` that is customized and then called in the next command

`php artisan generate:model {model}`

- Looks for the template file corresponding to the Model name from the first command

Usage and Example
-----------------

[](#usage-and-example)

`php artisan generate:template Comment`

Configure the file based on configuration specs

```
 /**
  * The fields associated with the model
  *
  * @var array
  */
  public $fields = [
      'field_string' => [         // The name of the field
          'type' => 'string',     // In Migration and Request
          'default' => null,      // In Migration
          'required' => false,    // In Request
          'nullable' => true,     // In Migration and Request
          'extra_rules' => '',    // Validation rules other than 'nullable|required|type'
          'filterable' => true,   // Filterable via QueryBuilder, one of true|false|'exact'
      ],
  ];

  /**
   * Model that this model belongs to
   * Options below pertain only to the parent model
   * Used to create a relationship in the parent model and current model
   *
   * @var array
   */
  public $related = [
      'name' => 'Post
      'type' => 'hasMany'
  ];

  /**
   * Log activity of this model using spatie/laravel-activitylog
   *
   * @var boolean
   */
  public $logActivity = true;

  /**
   * Add media to this model using spatie/laravel-medialibrary
   *
   * @var boolean
   */
  public $addMedia = false;

```

`php artisan generate:model Comment`

Generates the following:

```
- Model in `app\Http`
- Resource Controller in `app\Http\Controllers\Api`
- Policy in `App\Http\Policies` and registers it in `App\Providers\AuthServiceProvider`
- Resource and Collection in `app\Http\Resources`
- Request in `app\Http\Requests`
- Factory in `database\factories`
- Migration in `database\migrations`
- Appends a resource route to `routes\api.php` or adds it to apiResource array

```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity64

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

Recently: every ~18 days

Total

12

Last Release

2752d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/58a63e488b8ee623aac3ba193a1349d8d4ebdb1bf926c27e97e76667318f52e7?d=identicon)[rossity](/maintainers/rossity)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/rossity-laravel-modelgenerator/health.svg)

```
[![Health](https://phpackages.com/badges/rossity-laravel-modelgenerator/health.svg)](https://phpackages.com/packages/rossity-laravel-modelgenerator)
```

###  Alternatives

[nasirkhan/laravel-starter

A CMS like modular Laravel starter project.

1.4k2.7k](/packages/nasirkhan-laravel-starter)[typicms/base

A modular multilingual CMS built with Laravel, enabling developers to manage structured content like pages, news, events, and more.

1.6k20.3k](/packages/typicms-base)[rupadana/filament-api-service

A simple api service for supporting filamentphp

204103.8k7](/packages/rupadana-filament-api-service)[larafast/fastapi

A Fast Laravel package to help you generate CRUD API Controllers and Resources, Model

1233.9k](/packages/larafast-fastapi)[justbetter/laravel-magento-prices

Generic package to push prices to Magento

2015.9k1](/packages/justbetter-laravel-magento-prices)[fleetbase/core-api

Core Framework and Resources for Fleetbase API

1225.0k10](/packages/fleetbase-core-api)

PHPackages © 2026

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