druidweb/genx 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

druidweb/genx

Composer 安装命令:

composer require druidweb/genx

包简介

A console generator/stubs package for the Druid Laravel starter kit.

README 文档

README

Coverage Build Status Total Downloads Latest Stable Version License

About

Genx overrides Laravel's Artisan make:* commands with Zen-formatted generators that produce clean, consistent PHP files. All generated code follows Zen coding standards with 2-space indentation, strict types, and optional final classes.

Installation

composer require druid/genx

Publish the configuration file:

php artisan genx:install

Configuration

After installation, configure Genx in config/genx.php:

Code Style Options

// Add declare(strict_types=1) to all generated files
'strict_types' => true,

// Make all generated classes final
'final_classes' => true,

Package Integrations

// Add Spatie Route Discovery attributes to controllers
'route_discovery' => false,

// Enable zenphp/modulr integration for modular architecture
'modulr' => false,

Generator Paths

Customize where each file type is generated:

'paths' => [
    'controller' => 'app/Http/Controllers',  // or 'app/Controllers' for flat structure
    'model' => 'app/Models',
    'middleware' => 'app/Http/Middleware',   // or 'app/Middleware' for flat structure
    // ... see config file for all options
],

Usage

Use Laravel's standard make:* commands - Genx automatically overrides them:

php artisan make:controller UserController
php artisan make:model Post
php artisan make:middleware RateLimiter
php artisan make:request StoreUserRequest

Route Discovery Integration

When route_discovery is enabled, generated controllers include Spatie Route Discovery attributes:

#[Route(middleware: ['auth', 'verified'])]
final class UserController extends Controller
{
    // ...
}

You'll be prompted to select which middleware to apply to each controller.

Modulr Integration

When modulr is enabled and you have zenphp/modulr installed, you can generate files within modules:

php artisan make:controller UserController --module=billing

Or use the interactive module generator which integrates with Genx prompts:

php artisan modules:make billing

Supported Generators

Genx overrides these Laravel generators:

  • make:cast
  • make:channel
  • make:class
  • make:command
  • make:component
  • make:controller
  • make:enum
  • make:event
  • make:exception
  • make:factory
  • make:interface
  • make:job
  • make:listener
  • make:mail
  • make:middleware
  • make:migration
  • make:model
  • make:notification
  • make:observer
  • make:policy
  • make:provider
  • make:request
  • make:resource
  • make:rule
  • make:scope
  • make:seeder
  • make:test
  • make:trait
  • make:view

Contributing

Please see CONTRIBUTING.md for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

License

The MIT License (MIT). Please see License File for more information.

Credits

  • Built by Jetstream Labs

Support

druidweb/genx 适用场景与选型建议

druidweb/genx 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 191 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 01 月 05 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「laravel」 「stubs」 「generators」 「zen」 「druid」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 druidweb/genx 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 druidweb/genx 我们能提供哪些服务?
定制开发 / 二次开发

基于 druidweb/genx 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 191
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 29
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-05