'array' ]; /** * Get the translated name. * * @return string */ public function getNameAttribute() { $names = $this->activities_name; if (is_array($names)) { $locale = \Kernel\Translator::getLocale() ?: 'pt_BR'; return $names[$locale] ?? $names['pt_BR'] ?? array_shift($names); } return $names; } }