Skip to content

Commit dcc6123

Browse files
committed
fix formatting. fix bug.
1 parent e5fa9e4 commit dcc6123

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/Illuminate/Routing/Console/ControllerMakeCommand.php

+5-3
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,10 @@ protected function getStub()
4747
$stub = '/stubs/controller.stub';
4848
}
4949

50-
if ($this->option('api') && $stub !== null) {
51-
$stub = substr_replace($stub, '.api', -5, 0);
50+
if ($this->option('api') && is_null($stub)) {
51+
$stub = '/stubs/controller.api.stub';
52+
} elseif ($this->option('api') && ! is_null($stub)) {
53+
$stub = str_replace('.stub', '.api.stub', $stub);
5254
}
5355

5456
$stub = $stub ?? '/stubs/controller.plain.stub';
@@ -176,7 +178,7 @@ protected function getOptions()
176178

177179
['parent', 'p', InputOption::VALUE_OPTIONAL, 'Generate a nested resource controller class.'],
178180

179-
['api', 'a', InputOption::VALUE_NONE, 'Generate api resource methods only for a controller class.'],
181+
['api', null, InputOption::VALUE_NONE, 'Exclude the create and edit methods from the controller.'],
180182
];
181183
}
182184
}

0 commit comments

Comments
 (0)