Merge branch 'master' of https://github.com/yanwenwu/catch-admin
This commit is contained in:
commit
46c7307736
@ -78,38 +78,9 @@ class CreateModuleCommand extends Command
|
||||
}
|
||||
|
||||
$this->output->info('🎉 create controller successfully');
|
||||
$this->createView($controllers);
|
||||
$this->createRequest($controllers);
|
||||
}
|
||||
|
||||
|
||||
|
||||
protected function createView($controllers)
|
||||
{
|
||||
$viewPath = $this->moduleDir . 'view' . DIRECTORY_SEPARATOR;
|
||||
|
||||
CatchAdmin::makeDirectory($viewPath);
|
||||
|
||||
$default = ['index.', 'create.', 'edit.'];
|
||||
|
||||
$viewSuffix = config('view.view_suffix');
|
||||
|
||||
if (count($controllers) === 1) {
|
||||
foreach ($default as $v) {
|
||||
file_put_contents($viewPath . $v .$viewSuffix, '');
|
||||
}
|
||||
} else {
|
||||
foreach ($controllers as $controller) {
|
||||
CatchAdmin::makeDirectory($viewPath . ucwords($controller));
|
||||
foreach ($default as $v) {
|
||||
file_put_contents($viewPath . ucwords($controller) . DIRECTORY_SEPARATOR .$v . $viewSuffix, '');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->output->info('🎉 create view successfully');
|
||||
}
|
||||
|
||||
protected function createRequest($controllers)
|
||||
{
|
||||
$requestPath = $this->moduleDir . DIRECTORY_SEPARATOR . 'request' . DIRECTORY_SEPARATOR;
|
||||
|
@ -16,8 +16,8 @@ class ModelGeneratorCommand extends Command
|
||||
protected function configure()
|
||||
{
|
||||
$this->setName('create:model')
|
||||
->addArgument('model', Argument::REQUIRED, 'model name')
|
||||
->addArgument('module', Argument::REQUIRED, 'module name')
|
||||
->addArgument('model', Argument::REQUIRED, 'model name')
|
||||
->setDescription('create model');
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user