Skip to content

Commit 41538df

Browse files
committed
Fixes a bug that prevented the generator from using custom templates
1 parent ad870bf commit 41538df

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

src/Commands/CreateRoutesCommand.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function handle()
5959
$this->replaceModelName($stub, $input->modelName)
6060
->replaceControllerName($stub, $controllnerName)
6161
->replaceRouteNames($stub, $this->getModelName($input->modelName), $input->prefix)
62-
->processRoutesGroup($stub, $input->prefix, $input->controllerDirectory, $input->template)
62+
->processRoutesGroup($stub, $input->prefix, $input->controllerDirectory)
6363
->appendToRoutesFile($stub, $routesFile)
6464
->info('The routes were added successfully.');
6565
}
@@ -75,14 +75,12 @@ protected function getCommandInput()
7575
$controllerName = trim($this->option('controller-name')) ?: Helpers::postFixWith($modelName, 'Controller');
7676
$prefix = ($this->option('routes-prefix') == 'default-form') ? Helpers::makeRouteGroup($modelName) : $this->option('routes-prefix');
7777
$prefix = str_replace('\\', '/', $prefix);
78-
$template = $this->getTemplateName();
7978
$controllerDirectory = trim($this->option('controller-directory'));
8079

8180
return (object) compact(
8281
'modelName',
8382
'controllerName',
8483
'prefix',
85-
'template',
8684
'controllerDirectory'
8785
);
8886
}
@@ -153,11 +151,10 @@ protected function replacePrefix(&$stub, $prefix)
153151
* @param string $stub
154152
* @param string $prefix
155153
* @param string $namespace
156-
* @param string $template
157154
*
158155
* @return $this
159156
*/
160-
protected function processRoutesGroup(&$stub, $prefix, $namespace, $template)
157+
protected function processRoutesGroup(&$stub, $prefix, $namespace)
161158
{
162159
$prefix = trim($prefix);
163160

src/Traits/CommonCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ protected function getViewTemplateName($view)
346346
*/
347347
protected function getStubContent($name, $template = null)
348348
{
349-
return $this->getFileContent($this->getStubByName($name, $template));
349+
return $this->getFileContent($this->getStubByName($name, $template ?: $this->getTemplateName()));
350350
}
351351

352352
/**

0 commit comments

Comments
 (0)