getAttribute('table')}.{$field}]" : ""; break; case "status": $rule = "required|trim|string"; break; default: $rule = parent::getFormRule($action, $field); break; } return $rule; } public function getFormOption(string $field, array $options = ['options' => [], 'extras' => [], 'atttributes' => []]): array { $tempOptions = ['' => lang("{$this->getAttribute('class_path')}.label.{$field}") . " 선택"]; switch ($field) { case 'lineinfo_uid': foreach (service('equipment_lineservice')->getEntities() as $entity) { $tempOptions[$entity->getPK()] = $entity->getTitle(); // $options['attributes'][$entity->getPK()] = ['data-role' => implode(DEFAULTS['DELIMITER_ROLE'], $entity->getRole())]; } $options['options'] = $tempOptions; break; case 'old_clientinfo_uid': foreach (service('customer_clientservice')->getEntities() as $entity) { $tempOptions[$entity->getPK()] = $entity->getTitle(); // $options['attributes'][$entity->getPK()] = ['data-role' => implode(DEFAULTS['DELIMITER_ROLE'], $entity->getRole())]; } // dd($tempOptions); $options['options'] = $tempOptions; break; case 'serverinfo_uid': foreach (service('equipment_serverservice')->getEntities() as $entity) { $tempOptions[$entity->getPK()] = $entity->getTitle(); // $options['attributes'][$entity->getPK()] = ['data-role' => implode(DEFAULTS['DELIMITER_ROLE'], $entity->getRole())]; } $options['options'] = $tempOptions; break; default: $options = parent::getFormOption($field, $options); break; } return $options; } }