Skip to content

Commit a2f0aa2

Browse files
authored
Fix the generated API routes
Fix #186
2 parents 9b23898 + 8ec7281 commit a2f0aa2

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "crestapps/laravel-code-generator",
33
"license": "MIT",
44
"description": "An intelligent code generator for Laravel framework that will save you time! This awesome tool will help you generate resources like views, controllers, routes, migrations, languages and/or form-requests! It is extremely flexible and customizable to cover many on the use cases. It is shipped with cross-browsers compatible template, along with a client-side validation to modernize your application.",
5-
"version": "v2.4.8",
5+
"version": "v2.4.9",
66
"keywords": [
77
"laravel","crud","crud generator",
88
"laravel crud generator","laravel crud builder",

src/Commands/Framework/CreateRoutesCommand.php

+4-5
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class CreateRoutesCommand extends Command
2727
{--routes-prefix=default-form : Prefix of the route group.}
2828
{--controller-directory= : The directory where the controller is under.}
2929
{--without-route-clause : Create the routes without where clause for the id.}
30-
{--routes-type= : The type of the route to create "api", "api-docs" or web.}
30+
{--routes-type= : The type of the route to create. (i.e., "api", "api-docs" or "web".)}
3131
{--api-version= : The api version to prefix your resurces with.}
3232
{--template-name= : The template name to use when generating the code.}';
3333

@@ -62,11 +62,10 @@ public function handle()
6262
}
6363

6464
$stub = $this->getRoutesStub($input->type);
65-
$controllnerName = $this->getControllerName($input->controllerName, $input->controllerDirectory);
66-
$controllerNamespace = $this->getControllersNamespace($controllnerName, $input->controllerDirectory);
65+
$controllerNamespace = $this->getControllersNamespace($input->controllerName, $input->controllerDirectory);
6766
$useControllerLine = $this->getUseClassCommand($controllerNamespace);
6867
$this->replaceModelName($stub, $input->modelName)
69-
->replaceControllerName($stub, $controllnerName)
68+
->replaceControllerName($stub, $input->controllerName)
7069
->replaceRouteNames($stub, $this->getModelName($input->modelName), $namePrefix)
7170
->processRoutesGroup($stub, $input)
7271
->replaceRouteIdClause($stub, $this->getRouteIdClause($input->withoutRouteClause))
@@ -89,7 +88,7 @@ protected function getControllersNamespace($controllnerName, $controllerDirector
8988
{
9089
$controllerPath = Config::getControllersPath($controllerDirectory);
9190

92-
$path = Helpers::getAppNamespace($controllerDirectory, $controllerPath, $controllnerName);
91+
$path = Helpers::getAppNamespace($controllerPath, $controllnerName);
9392

9493
return Helpers::fixNamespace($path);
9594
}

0 commit comments

Comments
 (0)