Skip to content
This repository was archived by the owner on Apr 16, 2024. It is now read-only.

Commit 4c09683

Browse files
committed
change make:controller params order
For consistency with the rest of the commands
1 parent 9a8d64c commit 4c09683

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

TODO.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
- [ ] Specifying Laravel version on installation
1+
- [x] Specifying Laravel version on installation
22
- [ ] Documentation
33
- [ ] Change namespace using CLI
44
- > By extending `Illuminate\Foundation\Console\AppNameCommand`

src/Commands/ControllerMakeCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public function fire()
6767
$this->info('Controller class created successfully.'.
6868
"\n".
6969
"\n".
70-
'Find it at <comment>'.strstr($controller, 'src/').'</comment>'."\n"
70+
'Find it at <comment>'.$controller.'</comment>'."\n"
7171
);
7272
} catch (Exception $e) {
7373
$this->error($e->getMessage());
@@ -82,8 +82,8 @@ public function fire()
8282
protected function getArguments()
8383
{
8484
return [
85-
['service', InputArgument::REQUIRED, 'The service in which the controller should be generated.'],
8685
['controller', InputArgument::REQUIRED, 'The controller\'s name.'],
86+
['service', InputArgument::OPTIONAL, 'The service in which the controller should be generated.'],
8787
];
8888
}
8989

src/Finder.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -479,12 +479,15 @@ public function findControllerNamespace($service)
479479
*/
480480
public function listServices()
481481
{
482-
$finder = new SymfonyFinder();
483-
484482
$services = new Collection();
485-
foreach ($finder->directories()->depth('== 0')->in($this->findServicesRootPath())->directories() as $dir) {
486-
$realPath = $dir->getRealPath();
487-
$services->push(new Service($dir->getRelativePathName(), $realPath, $this->relativeFromReal($realPath)));
483+
484+
if (file_exists($this->findServicesRootPath())) {
485+
$finder = new SymfonyFinder();
486+
487+
foreach ($finder->directories()->depth('== 0')->in($this->findServicesRootPath())->directories() as $dir) {
488+
$realPath = $dir->getRealPath();
489+
$services->push(new Service($dir->getRelativePathName(), $realPath, $this->relativeFromReal($realPath)));
490+
}
488491
}
489492

490493
return $services;

0 commit comments

Comments
 (0)