Methods
Preconditions
Get an instance of the translation model
translate(?string $locale = null, bool $withFallback = false)
$post->translate(); // returns the german translation model
$post->translate('fr'); // returns the french translation model
$post->translate('it'); // returns null
$post->translate('it', true); // returns the english translation modeltranslateOrDefault(?string $locale = null)
translateOrNew(?string $locale = null)
hasTranslation(?string $locale = null)
translations()
deleteTranslations(string|array $locales = null)
getTranslationsArray()
replicateWithTranslations(array $except = null)
getDefaultLocale()
setDefaultLocale(?string $locale)
Translation Autoloading
static enableAutoloadTranslations()
static disableAutoloadTranslations()
static defaultAutoloadTranslations()
Last updated
Was this helpful?