diff --git a/src/Illuminate/Routing/Console/MakeControllerCommand.php b/src/Illuminate/Routing/Console/MakeControllerCommand.php index cf87b6faae58..db44b48e3595 100644 --- a/src/Illuminate/Routing/Console/MakeControllerCommand.php +++ b/src/Illuminate/Routing/Console/MakeControllerCommand.php @@ -92,6 +92,20 @@ protected function getPath() { return $this->laravel['path.base'].'/'.$this->input->getOption('path'); } + + //option to set path to a workbench + $bench = $this->input->getOption('bench'); + if ( ! is_null($bench)) + { + $path = $this->laravel['path.base'] . "/workbench/{$bench}/src/controllers"; + + if(!is_dir($path)) + { + mkdir($path); + } + + return $path; + } return $this->path; } @@ -149,7 +163,9 @@ protected function getOptions() array('except', null, InputOption::VALUE_OPTIONAL, 'The methods that should be excluded'), array('path', null, InputOption::VALUE_OPTIONAL, 'Where to place the controller'), + + array('bench', null, InputOption::VALUE_OPTIONAL, 'Place the controller in a workbench'), ); } -} \ No newline at end of file +}