From cf10c68d1c2bafccc88ded400b1e62d570a93fdf Mon Sep 17 00:00:00 2001 From: Raf Date: Sun, 20 Jan 2013 02:38:36 +0500 Subject: [PATCH 1/2] Allow --bench option for Controller:make This allow the option to set controller path to a workbench --- .../Routing/Console/MakeControllerCommand.php | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/Illuminate/Routing/Console/MakeControllerCommand.php b/src/Illuminate/Routing/Console/MakeControllerCommand.php index cf87b6faae58..e5ac6f6ae6a0 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; } @@ -152,4 +166,4 @@ protected function getOptions() ); } -} \ No newline at end of file +} From a844de976c920a4882a4d5ad11f2e5897ff848a4 Mon Sep 17 00:00:00 2001 From: Raf Date: Sun, 20 Jan 2013 02:41:55 +0500 Subject: [PATCH 2/2] Added bench option to Controller:make console --- src/Illuminate/Routing/Console/MakeControllerCommand.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Illuminate/Routing/Console/MakeControllerCommand.php b/src/Illuminate/Routing/Console/MakeControllerCommand.php index e5ac6f6ae6a0..db44b48e3595 100644 --- a/src/Illuminate/Routing/Console/MakeControllerCommand.php +++ b/src/Illuminate/Routing/Console/MakeControllerCommand.php @@ -163,6 +163,8 @@ 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'), ); }