PHPackages                             naranarethiya/model-resource-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. [API Development](/categories/api)
4. /
5. naranarethiya/model-resource-generator

ActiveLibrary[API Development](/categories/api)

naranarethiya/model-resource-generator
======================================

Automatically generate API resource classes for your Laravel models, simplifying the process of transforming your models into API resources with ease.

0.0.3(1y ago)213MITPHP

Since Jul 26Pushed 1y agoCompare

[ Source](https://github.com/naranarethiya/laravel-model-resource-generator)[ Packagist](https://packagist.org/packages/naranarethiya/model-resource-generator)[ RSS](/packages/naranarethiya-model-resource-generator/feed)WikiDiscussions main Synced yesterday

READMEChangelog (3)Dependencies (4)Versions (5)Used By (0)

Laravel Model Resource Generator
================================

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

`model-resource-generator` is a custom Laravel command that generates API resource classes for all available models in your Laravel application. It includes the existing columns and relations of each model in the generated resource classes.

It respects your model's hidden attributes and does not load any relations automatically. It adjusts the API attributes based on whether relations are loaded or not.

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require naranarethiya/model-resource-generator
```

Usage
-----

[](#usage)

To generate API resources for models located in the app/Models directory:

```
php artisan generate:api-resources
```

To specify a different directory or a single model file:

```
php artisan generate:api-resources --model-path=app/CustomModels
```

### Options

[](#options)

`--model-path` (optional): Specify the directory path to search for models or a single model file path. If not provided, it defaults to **app/Models**

Features
--------

[](#features)

- Automatically generates API resource classes for each model found in the specified directory.
- Includes existing columns and relations in the generated resource classes.
- Exclude all hidden attributes
- Provides an option to overwrite existing resources or skip them.
- Outputs a summary of the generated, skipped, and overwritten resources.

Contributing
------------

[](#contributing)

Contributions are welcome! Please submit a pull request or open an issue to suggest changes or report problems.

License
-------

[](#license)

This package is open-source software licensed under the MIT license.

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance32

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity33

Early-stage or recently created project

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

Total

3

Last Release

696d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/6211813?v=4)[Naran Arethiya](/maintainers/naranarethiya)[@naranarethiya](https://github.com/naranarethiya)

---

Top Contributors

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

---

Tags

api-resourcesgeneratorlaravellaravel-api-resource

###  Code Quality

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

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

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

###  Alternatives

[statamic/cms

The Statamic CMS Core Package

4.8k3.6M986](/packages/statamic-cms)[darkaonline/l5-swagger

OpenApi or Swagger integration to Laravel

3.0k37.6M134](/packages/darkaonline-l5-swagger)[knuckleswtf/scribe

Generate API documentation for humans from your Laravel codebase.✍

2.3k14.2M63](/packages/knuckleswtf-scribe)[statamic-rad-pack/runway

Eloquently manage your database models in Statamic.

135224.7k7](/packages/statamic-rad-pack-runway)[scriptdevelop/whatsapp-manager

Paquete para manejo de WhatsApp Business API en Laravel

783.8k](/packages/scriptdevelop-whatsapp-manager)[duncanmcclean/statamic-cargo

Comprehensive e-commerce addon for Statamic. Build bespoke e-commerce sites without the complexity.

3416.9k](/packages/duncanmcclean-statamic-cargo)

PHPackages © 2026

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