Файл: src/vendor/way/generators/src/Way/Generators/Commands/ModelGeneratorCommand.php
Строк: 68
<?php namespace WayGeneratorsCommands;
use SymfonyComponentConsoleInputInputOption;
use SymfonyComponentConsoleInputInputArgument;
class ModelGeneratorCommand extends GeneratorCommand {
/**
* The console command name.
*
* @var string
*/
protected $name = 'generate:model';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Generate a model';
/**
* The path to where the file will be created.
*
* @return mixed
*/
protected function getFileGenerationPath()
{
$path = $this->getPathByOptionOrConfig('path', 'model_target_path');
return $path. '/' . ucwords($this->argument('modelName')) . '.php';
}
/**
* Fetch the template data.
*
* @return array
*/
protected function getTemplateData()
{
return [
'NAME' => ucwords($this->argument('modelName')),
'NAMESPACE' => 'App'
];
}
/**
* Get path to the template for the generator.
*
* @return mixed
*/
protected function getTemplatePath()
{
return $this->getPathByOptionOrConfig('templatePath', 'model_template_path');
}
/**
* Get the console command arguments.
*
* @return array
*/
protected function getArguments()
{
return [
['modelName', InputArgument::REQUIRED, 'The name of the desired Eloquent model']
];
}
}