/** * Parse a translation. * * @param EloquentModel $translation * @param $string */ protected function parseTranslation(EloquentModel $translation, &$string) { $string .= "\n["; foreach ($translation->getAttributes() as $key => $value) { $value = $translation->getAttribute($key); if (is_string($value)) { $value = addslashes($value); } $string .= "\n'{$key}' => '{$value}',"; } $string .= "\n],"; }