Файл: gapps/vendor/laravel/framework/src/Illuminate/Routing/Console/ControllerMakeCommand.php
Строк: 90
<?php
namespace IlluminateRoutingConsole;
use IlluminateConsoleGeneratorCommand;
use SymfonyComponentConsoleInputInputOption;
class ControllerMakeCommand extends GeneratorCommand
{
/**
* The console command name.
*
* @var string
*/
protected $name = 'make:controller';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Create a new controller class';
/**
* The type of class being generated.
*
* @var string
*/
protected $type = 'Controller';
/**
* Get the stub file for the generator.
*
* @return string
*/
protected function getStub()
{
if ($this->option('resource')) {
return __DIR__.'/stubs/controller.stub';
}
return __DIR__.'/stubs/controller.plain.stub';
}
/**
* Get the default namespace for the class.
*
* @param string $rootNamespace
* @return string
*/
protected function getDefaultNamespace($rootNamespace)
{
return $rootNamespace.'HttpControllers';
}
/**
* Get the console command options.
*
* @return array
*/
protected function getOptions()
{
return [
['resource', null, InputOption::VALUE_NONE, 'Generate a resource controller class.'],
];
}
/**
* Build the class with the given name.
*
* Remove the base controller import if we are already in base namespace.
*
* @param string $name
* @return string
*/
protected function buildClass($name)
{
$namespace = $this->getNamespace($name);
return str_replace("use $namespaceController;n", '', parent::buildClass($name));
}
}