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

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

jmjl161100/laravel-code-generator
=================================

Laravel Code Generator.

v1.0.0(1y ago)120MITPHPPHP ^8.2

Since Apr 11Pushed 1y ago1 watchersCompare

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

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

Laravel Code Generator
======================

[](#laravel-code-generator)

一款为 Laravel 项目设计的现代化代码生成工具，可快速生成控制器、服务类等模板代码，支持自定义模板。

功能特性
----

[](#功能特性)

- 🚀 快速生成标准化的 Laravel 组件代码
- 📁 支持自定义模板（Stubs）文件
- 📦 开箱即用的 Laravel 服务集成
- 🔧 遵循 PSR-4 规范生成代码结构

安装
--

[](#安装)

通过 Composer 安装：

```
composer require jmjl161100/laravel-code-generator
```

配置
--

[](#配置)

### 发布配置文件（可选）

[](#发布配置文件可选)

```
php artisan vendor:publish --provider="Jmjl161100\LaravelCodeGenerator\CodeGeneratorServiceProvider" --tag=codegenerator-config
```

生成配置文件 `config/codegenerator.php`，可配置以下选项：

```
return [
    // 默认模板组
    'default' => [
        'stubs_path' => base_path('stubs'), // 模板路径
        'default_target_path' => base_path(), // 目标路径
        'preserve_suffixes' => [ // 保留后缀
            'Controller',
            'Service',
        ],
    ],
    // 自定义模板组
    'key' => [
        'stubs_path' => '',
        'default_target_path' => '',
        'preserve_suffixes' => [
            //
        ],
    ],
];
```

### 发布模板文件（可选）

[](#发布模板文件可选)

```
php artisan vendor:publish --provider="Jmjl161100\LaravelCodeGenerator\CodeGeneratorServiceProvider" --tag=codegenerator-stubs
```

artisan
-------

[](#artisan)

```
php artisan generate:code   {name : The name of the generated component}
                            {--stub_id=default : The stub ID in config}
                            {--target= : The target directory}
                            {--f|force : Overwrite existing files}
```

使用说明
----

[](#使用说明)

执行 php artisan generate:code {name} 后根据 config/codegenerator.php 配置在目标路径下生成与模板路径同层级关系的文件，并根据 name 自动生成新文件名称

使用示例
----

[](#使用示例)

```
php artisan generate:code Productsa
```

许可证
---

[](#许可证)

本项目基于 [MIT 许可证](LICENSE) 开源。

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance48

Moderate activity, may be stable

Popularity8

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 87.5% 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

396d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8239522181ae7c93847a2cf5e03082ebdb18406d7b43ba7df1c0b19880711d23?d=identicon)[jmjl161100](/maintainers/jmjl161100)

---

Top Contributors

[![jmjl161100](https://avatars.githubusercontent.com/u/207161202?v=4)](https://github.com/jmjl161100 "jmjl161100 (7 commits)")[![jmjl211](https://avatars.githubusercontent.com/u/127288325?v=4)](https://github.com/jmjl211 "jmjl211 (1 commits)")

###  Code Quality

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/jmjl161100-laravel-code-generator/health.svg)

```
[![Health](https://phpackages.com/badges/jmjl161100-laravel-code-generator/health.svg)](https://phpackages.com/packages/jmjl161100-laravel-code-generator)
```

###  Alternatives

[wireui/wireui

TallStack components

1.8k1.3M16](/packages/wireui-wireui)[livewire/volt

An elegantly crafted functional API for Laravel Livewire.

4195.3M84](/packages/livewire-volt)[ramonrietdijk/livewire-tables

Dynamic tables for models with Laravel Livewire

21147.4k](/packages/ramonrietdijk-livewire-tables)

PHPackages © 2026

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