/** * @param AbstractAttribute $attribute * @param array $data */ protected function addLabels(AbstractAttribute $attribute, $data) { foreach ($data as $key => $label) { if (strpos($key, 'label-') !== false) { $locale = str_replace('label-', '', $key); $translation = $attribute->getTranslation($locale); $translation->setLabel($label); } } }
/** * @param AbstractAttribute $attribute * @param array $data */ protected function addLabels(AbstractAttribute $attribute, $data) { foreach ($data['label'] as $locale => $label) { $translation = $attribute->getTranslation($locale); $translation->setLabel($label); } }