Skip to content

Make Controller ​

Generate a standard CRUD controller with repository injection for a module.

Command Information ​

  • Signature: modularous:make:controller {module} {name}
  • Category: Generators

Arguments ​

ArgumentRequiredDescription
moduleYesThe module the controller belongs to (e.g. Blog)
nameYesController class name (e.g. Post → generates PostController)

What It Does ​

Creates a {Name}Controller.php stub inside the module's Http/Controllers/ directory. The generated controller extends Modularous base controller and is wired to accept the matching repository via constructor injection.

Examples ​

bash
php artisan modularous:make:controller Blog Post
# → Modules/Blog/Http/Controllers/PostController.php

php artisan modularous:make:controller Shop Product