diff --git a/src/Providers/ConsoleServiceProvider.php b/src/Providers/ConsoleServiceProvider.php index 08ae0c40..923b8a56 100644 --- a/src/Providers/ConsoleServiceProvider.php +++ b/src/Providers/ConsoleServiceProvider.php @@ -38,6 +38,7 @@ public function register() $this->registerMigrateRollbackCommand(); $this->registerSeedCommand(); $this->registerListCommand(); + $this->registerMakeControllerCommand(); $this->commands([ 'modules.make', @@ -50,7 +51,8 @@ public function register() 'modules.migrateReset', 'modules.migrateRollback', 'modules.seed', - 'modules.list' + 'modules.list', + 'modules.makeController', ]); } @@ -191,4 +193,19 @@ protected function registerListCommand() return new \Caffeinated\Modules\Console\Commands\ModuleListCommand($app['modules']); }); } + + /** + * Register the "module:make:controller" console command. + * + * @return Console\ModuleMakeControllerCommand + */ + protected function registerMakeControllerCommand() + { + $this->app->bindShared('modules.makeController', function($app) { + $handler = new \Caffeinated\Modules\Console\Handlers\ModuleMakeControllerHandler($app['modules'], $app['files']); + + return new \Caffeinated\Modules\Console\Commands\ModuleMakeControllerCommand($handler); + }); + } + }