From 825a8a5e8cdf18f50535974ec96b5ee20ab8043b Mon Sep 17 00:00:00 2001 From: hamrahpay Date: Thu, 3 Dec 2015 21:51:22 +0330 Subject: [PATCH] Update ConsoleServiceProvider.php --- src/Providers/ConsoleServiceProvider.php | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) 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); + }); + } + }