public function getInputFields()
 {
     $fields = [];
     $this->commandObj->info('Specify fields for the model (skip id & timestamp fields, will be added automatically)');
     $this->commandObj->info('Enter exit to finish');
     while (true) {
         $fieldInputStr = $this->commandObj->ask('Field: (field_name:field_database_type)', '');
         if (empty($fieldInputStr) || $fieldInputStr == false || $fieldInputStr == 'exit') {
             break;
         }
         if (!GeneratorUtils::validateFieldInput($fieldInputStr)) {
             $this->commandObj->error('Invalid Input. Try again');
             continue;
         }
         $type = $this->commandObj->ask('Enter field html input type (text): ', 'text');
         $validations = $this->commandObj->ask('Enter validations: ', false);
         $validations = $validations == false ? '' : $validations;
         $fields[] = GeneratorUtils::processFieldInput($fieldInputStr, $type, $validations);
     }
     return $fields;
 }
 public function getInputFields()
 {
     $fields = [];
     $this->commandObj->info("Specify fields for the model (skip id & timestamp fields, will be added automatically)");
     $this->commandObj->info("Enter exit to finish");
     while (true) {
         $fieldInputStr = $this->commandObj->ask("Field:", '');
         if (empty($fieldInputStr) || $fieldInputStr == false || $fieldInputStr == "exit") {
             break;
         }
         if (!GeneratorUtils::validateFieldInput($fieldInputStr)) {
             $this->commandObj->error("Invalid Input. Try again");
             continue;
         }
         $type = $this->commandObj->ask("Enter field type (text): ", "text");
         $validations = $this->commandObj->ask("Enter validations: ", false);
         $validations = $validations == false ? '' : $validations;
         $fields[] = GeneratorUtils::processFieldInput($fieldInputStr, $type, $validations);
     }
     return $fields;
 }
Пример #3
0
 public function getInputFields()
 {
     $fields = [];
     $this->commandObj->info("Specify fields for the model (skip id & timestamp fields, will be added automatically)");
     $this->commandObj->info("Left blank to finish");
     while (true) {
         $fieldInputStr = $this->commandObj->ask("Field:");
         if (empty($fieldInputStr)) {
             break;
         }
         if (!GeneratorUtils::validateFieldInput($fieldInputStr)) {
             $this->commandObj->error("Invalid Input. Try again");
             continue;
         }
         $validations = $this->commandObj->ask("Enter validations: ");
         $fields[] = GeneratorUtils::processFieldInput($fieldInputStr, $validations);
     }
     return $fields;
 }