druidweb/genx

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

Maintainers

Details

github.com/druidweb/genx

Source

Issues

Installs: 13

Dependents: 1

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 0

pkg:composer/druidweb/genx

v1.0.0 2026-01-05 21:11 UTC

This package is auto-updated.

Last update: 2026-01-07 14:52:49 UTC


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