PHPackages                             frahjokhio/module-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. [Framework](/categories/framework)
4. /
5. frahjokhio/module-generator

ActiveLibrary[Framework](/categories/framework)

frahjokhio/module-generator
===========================

A Laravel package to generate modular structure with CRUD boilerplate.

v1.0.0(5mo ago)48MITPHPPHP ^8.2

Since Nov 12Pushed 5mo agoCompare

[ Source](https://github.com/frahjokhio/laravel-module-generator)[ Packagist](https://packagist.org/packages/frahjokhio/module-generator)[ RSS](/packages/frahjokhio-module-generator/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

Laravel Module Generator
========================

[](#laravel-module-generator)

[![License: MIT](https://camo.githubusercontent.com/08cef40a9105b6526ca22088bc514fbfdbc9aac1ddbf8d4e6c750e3a88a44dca/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d626c75652e737667)](LICENSE)

A Laravel package to quickly generate modular structures with CRUD boilerplate for APIs.
It scaffolds Controllers, Services, Repositories, Requests, Models, routes, and Service Providers for fast and consistent modular development.

---

🚀 Installation
--------------

[](#-installation)

```
composer require frahjokhio/module-generator
```

---

⚙️ Usage
--------

[](#️-usage)

Generate a new module:

```
php artisan make:module ModuleName
```

The command will prompt you for:

- Migration creation
- Seeder creation
- Column definitions for the migration

---

🧱 Column Definition Format
--------------------------

[](#-column-definition-format)

Each column follows this format:

```
column_name:type:modifier1:modifier2,...

```

- Separate each column with a comma `,`
- Separate properties of a single column with a colon `:`
- Modifiers like `nullable`, `unique`, or `default(...)` are optional

### Examples

[](#examples)

ColumnExampleDescriptionString`title:string:unique`Simple string with unique constraintNullable`slug:string:unique:nullable`String column that can be nullText`content:text:nullable`Large text fieldEnum`status:enum:draft|published|archived:default('draft')`Enum with allowed values and default valueBoolean`is_featured:boolean:default(false)`Boolean with default valueForeign Key`user_id:foreignId:constrained`Foreign key to `users.id`### Example Input

[](#example-input)

```
title:string:unique,
user_id:integer,
slug:string:unique:nullable,
content:text:nullable,
status:enum:draft|published|archived:default('draft'),
is_featured:boolean:default(false),
user_id:foreignId:constrained

```

---

🧩 Validation Mapping
--------------------

[](#-validation-mapping)

When generating Form Requests, each column type automatically maps to appropriate validation rules.

TypeValidation Rulestring`string|max:255`text`string|max:255`email`email|max:255`password`string|min:8|max:255`integer, bigint`integer`boolean`boolean`float, decimal, double`numeric`date, datetime, timestamp`date`json`array`foreignId`integer` + `exists:table,id` if `constrained`enum`in:value1,value2,...`### Other Rule Behaviors

[](#other-rule-behaviors)

- Adds `'required'` unless the field is `nullable` or has a `default(...)`
- Adds `Rule::unique('table', 'column')` if `unique` is specified
- Enum values are parsed automatically from the definition

---

📁 Generated Module Structure
----------------------------

[](#-generated-module-structure)

```
Modules/
└── ModuleName/
    ├── Controllers/
    ├── Services/
    ├── Repositories/
    ├── Requests/
    ├── Models/
    ├── Routes/
    └── ModuleNameServiceProvider.php

```

---

✨ Features
----------

[](#-features)

- Auto-generates:
    - Controller with CRUD methods
    - Service and Repository for logic separation
    - FormRequest with validation rules
    - Model with `$fillable` properties
    - API routes and module provider
- Optional migration and seeder generation
- Laravel 12 compatible
- Requires PHP 8.2 or above

---

📜 License
---------

[](#-license)

MIT License.

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance69

Regular maintenance activity

Popularity9

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity47

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

178d ago

### Community

Maintainers

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

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/frahjokhio-module-generator/health.svg)

```
[![Health](https://phpackages.com/badges/frahjokhio-module-generator/health.svg)](https://phpackages.com/packages/frahjokhio-module-generator)
```

###  Alternatives

[laravel/socialite

Laravel wrapper around OAuth 1 &amp; OAuth 2 libraries.

5.7k96.9M672](/packages/laravel-socialite)[laravel/horizon

Dashboard and code-driven configuration for Laravel queues.

4.2k84.2M224](/packages/laravel-horizon)[laravel/ui

Laravel UI utilities and presets.

2.7k134.9M597](/packages/laravel-ui)[laravel/jetstream

Tailwind scaffolding for the Laravel framework.

4.1k19.8M136](/packages/laravel-jetstream)[stancl/tenancy

Automatic multi-tenancy for your Laravel application.

4.3k6.6M40](/packages/stancl-tenancy)[internachi/modular

Modularize your Laravel apps

1.1k662.4k8](/packages/internachi-modular)

PHPackages © 2026

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