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.
composer require druid/genxPublish the configuration file:
php artisan genx:installAfter installation, configure Genx in config/genx.php:
// Add declare(strict_types=1) to all generated files
'strict_types' => true,
// Make all generated classes final
'final_classes' => true,// Add Spatie Route Discovery attributes to controllers
'route_discovery' => false,
// Enable zenphp/modulr integration for modular architecture
'modulr' => false,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
],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 StoreUserRequestWhen 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.
When modulr is enabled and you have zenphp/modulr installed, you can generate files within modules:
php artisan make:controller UserController --module=billingOr use the interactive module generator which integrates with Genx prompts:
php artisan modules:make billingGenx overrides these Laravel generators:
make:castmake:channelmake:classmake:commandmake:componentmake:controllermake:enummake:eventmake:exceptionmake:factorymake:interfacemake:jobmake:listenermake:mailmake:middlewaremake:migrationmake:modelmake:notificationmake:observermake:policymake:providermake:requestmake:resourcemake:rulemake:scopemake:seedermake:testmake:traitmake:view
Please see CONTRIBUTING.md for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.
- Built by Jetstream Labs
- Issues: GitHub Issues