/** * Get the title, used for validating a rule * * @param string $rule * @param array $params * @return string */ protected function getTitle($rule, $params = array()) { $params['attribute'] = $this->formHelper->formatLabel($this->field->getName()); return trans('validation.' . $rule, $params); }
/** * Set up a single child element for a collection * * @param FormField $field * @param $name * @param null $value * @return FormField */ protected function setupChild(FormField $field, $name, $value = null) { $newFieldName = $field->getName() . $name; $firstFieldOptions = $this->formHelper->mergeOptions($this->getOption('options'), ['attr' => ['id' => $newFieldName]]); $field->setName($newFieldName); $field->setOptions($firstFieldOptions); if ($value && !$field instanceof ChildFormType) { $value = $this->getModelValueAttribute($value, $this->getOption('property')); } $field->setValue($value); return $field; }