commandInfo() public method

public commandInfo ( $message )
 private function generateUpdateRequest()
 {
     $templateData = TemplateUtil::getTemplate('scaffold.request.update_request', 'laravel-generator');
     $templateData = TemplateUtil::fillTemplate($this->commandData->dynamicVars, $templateData);
     FileUtil::createFile($this->path, $this->updateFileName, $templateData);
     $this->commandData->commandComment("\nUpdate Request created: ");
     $this->commandData->commandInfo($this->updateFileName);
 }
 public function generate()
 {
     $templateData = TemplateUtil::getTemplate('model', 'laravel-generator');
     $templateData = $this->fillTemplate($templateData);
     FileUtil::createFile($this->path, $this->fileName, $templateData);
     $this->commandData->commandComment("\nModel created: ");
     $this->commandData->commandInfo($this->fileName);
 }
 private function generateUpdateRequest()
 {
     $templateData = TemplateUtil::getTemplate('api.request.update_request', 'laravel-generator');
     $templateData = TemplateUtil::fillTemplate($this->commandData->dynamicVars, $templateData);
     $fileName = 'Update' . $this->commandData->modelName . 'APIRequest.php';
     FileUtil::createFile($this->path, $fileName, $templateData);
     $this->commandData->commandComment("\nUpdate Request created: ");
     $this->commandData->commandInfo($fileName);
 }
 public function generate()
 {
     $templateData = TemplateUtil::getTemplate('api.controller.api_controller', 'laravel-generator');
     $templateData = TemplateUtil::fillTemplate($this->commandData->dynamicVars, $templateData);
     $templateData = $this->fillDocs($templateData);
     FileUtil::createFile($this->path, $this->fileName, $templateData);
     $this->commandData->commandComment("\nAPI Controller created: ");
     $this->commandData->commandInfo($this->fileName);
 }
 public function generate()
 {
     $templateData = TemplateUtil::getTemplate('migration', 'laravel-generator');
     $templateData = TemplateUtil::fillTemplate($this->commandData->dynamicVars, $templateData);
     $templateData = str_replace('$FIELDS$', $this->generateFields(), $templateData);
     $tableName = $this->commandData->dynamicVars['$TABLE_NAME$'];
     $fileName = date('Y_m_d_His') . '_' . 'create_' . $tableName . '_table.php';
     FileUtil::createFile($this->path, $fileName, $templateData);
     $this->commandData->commandComment("\nMigration created: ");
     $this->commandData->commandInfo($fileName);
 }
 public function generate()
 {
     $templateData = TemplateUtil::getTemplate('scaffold.controller.controller', 'laravel-generator');
     $templateData = TemplateUtil::fillTemplate($this->commandData->dynamicVars, $templateData);
     $paginate = $this->commandData->getOption('paginate');
     if ($paginate) {
         $templateData = str_replace('$RENDER_TYPE$', 'paginate(' . $paginate . ')', $templateData);
     } else {
         $templateData = str_replace('$RENDER_TYPE$', 'all()', $templateData);
     }
     $fileName = $this->commandData->modelName . 'Controller.php';
     FileUtil::createFile($this->path, $fileName, $templateData);
     $this->commandData->commandComment("\nController created: ");
     $this->commandData->commandInfo($fileName);
 }
 public function generate()
 {
     $templateData = TemplateUtil::getTemplate('repository', 'laravel-generator');
     $templateData = TemplateUtil::fillTemplate($this->commandData->dynamicVars, $templateData);
     $searchables = [];
     foreach ($this->commandData->inputFields as $field) {
         if ($field['searchable']) {
             $searchables[] = "'" . $field['fieldName'] . "'";
         }
     }
     $templateData = str_replace('$FIELDS$', implode(',' . infy_nl_tab(1, 2), $searchables), $templateData);
     FileUtil::createFile($this->path, $this->fileName, $templateData);
     $this->commandData->commandComment("\nRepository created: ");
     $this->commandData->commandInfo($this->fileName);
 }
 public function generate()
 {
     $templateData = TemplateUtil::getTemplate('repository', 'laravel-generator');
     $templateData = TemplateUtil::fillTemplate($this->commandData->dynamicVars, $templateData);
     $fillables = [];
     foreach ($this->commandData->inputFields as $field) {
         if ($field['searchable']) {
             $fillables[] = '"' . $field['fieldName'] . '"';
         }
     }
     $templateData = str_replace('$FIELDS$', implode(",\n\t\t", $fillables), $templateData);
     $fileName = $this->commandData->modelName . 'Repository.php';
     FileUtil::createFile($this->path, $fileName, $templateData);
     $this->commandData->commandComment("\nRepository created: ");
     $this->commandData->commandInfo($fileName);
 }
 private function generateUpdate()
 {
     $templateData = TemplateUtil::getTemplate('scaffold.views.edit', $this->templateType);
     $templateData = TemplateUtil::fillTemplate($this->commandData->dynamicVars, $templateData);
     FileUtil::createFile($this->path, 'edit.blade.php', $templateData);
     $this->commandData->commandInfo('edit.blade.php created');
 }
Ejemplo n.º 10
0
 private function saveSchemaFile()
 {
     $fileFields = [];
     foreach ($this->commandData->inputFields as $field) {
         $fileFields[] = ['fieldInput' => $field['fieldInput'], 'htmlType' => $field['htmlType'], 'validations' => $field['validations'], 'searchable' => $field['searchable']];
     }
     $path = config('infyom.laravel_generator.path.schema_files', base_path('resources/model_schemas/'));
     $fileName = $this->commandData->modelName . ".json";
     if (file_exists($path . $fileName)) {
         if (!$this->confirm("model file " . $fileName . " already exist. Do you want to overwrite it? [y|N]", false)) {
             return;
         }
     }
     FileUtil::createFile($path, $fileName, json_encode($fileFields, JSON_PRETTY_PRINT));
     $this->commandData->commandComment("\nSchema File saved: ");
     $this->commandData->commandInfo($fileName);
 }
 private function generateDataTable()
 {
     $templateData = TemplateUtil::getTemplate('scaffold.datatable', 'laravel-generator');
     $templateData = TemplateUtil::fillTemplate($this->commandData->dynamicVars, $templateData);
     $headerFieldTemplate = TemplateUtil::getTemplate('scaffold.views.datatable_column', $this->templateType);
     $headerFields = [];
     foreach ($this->commandData->inputFields as $field) {
         if (!$field['inIndex']) {
             continue;
         }
         $headerFields[] = $fieldTemplate = TemplateUtil::fillTemplateWithFieldData($this->commandData->dynamicVars, $this->commandData->fieldNamesMapping, $headerFieldTemplate, $field);
     }
     $path = $this->commandData->config->pathDataTables;
     $fileName = $this->commandData->modelName . 'DataTable.php';
     $fields = implode(',' . infy_nl_tab(1, 3), $headerFields);
     $templateData = str_replace('$DATATABLE_COLUMNS$', $fields, $templateData);
     FileUtil::createFile($path, $fileName, $templateData);
     $this->commandData->commandComment("\n{$fileName} created: ");
     $this->commandData->commandInfo($fileName);
 }
Ejemplo n.º 12
0
 private function generateShowFields()
 {
     $fieldTemplate = TemplateUtil::getTemplate('scaffold.views.show_field', $this->templateType);
     $fieldsStr = '';
     foreach ($this->commandData->inputFields as $field) {
         $singleFieldStr = str_replace('$FIELD_NAME_TITLE$', Str::title(str_replace('_', ' ', $field['fieldName'])), $fieldTemplate);
         $singleFieldStr = str_replace('$FIELD_NAME$', $field['fieldName'], $singleFieldStr);
         $singleFieldStr = TemplateUtil::fillTemplate($this->commandData->dynamicVars, $singleFieldStr);
         $fieldsStr .= $singleFieldStr . "\n\n";
     }
     FileUtil::createFile($this->path, 'show_fields.blade.php', $fieldsStr);
     $this->commandData->commandInfo('show_fields.blade.php created');
 }
Ejemplo n.º 13
0
 private function saveSchemaFile()
 {
     $fileFields = [];
     foreach ($this->commandData->inputFields as $field) {
         $fileFields[] = ['fieldInput' => $field['fieldInput'], 'htmlType' => $field['htmlType'], 'validations' => $field['validations'], 'searchable' => $field['searchable'], 'fillable' => $field['fillable'], 'primary' => $field['primary'], 'inForm' => $field['inForm'], 'inIndex' => $field['inIndex']];
     }
     $path = config('infyom.laravel_generator.path.schema_files', base_path('resources/model_schemas/'));
     $fileName = $this->commandData->modelName . '.json';
     if (file_exists($path . $fileName) && !$this->confirmOverwrite($fileName)) {
         return;
     }
     FileUtil::createFile($path, $fileName, json_encode($fileFields, JSON_PRETTY_PRINT));
     $this->commandData->commandComment("\nSchema File saved: ");
     $this->commandData->commandInfo($fileName);
 }