HasTranslation
trait HasTranslation (View source)
Traits
Translatable
Methods
string|null
getTranslationModelNameDefault()
Returns the fully qualified translation class name for this model.
Builder
scopeWithActiveTranslations(Builder $query, string|null $locale = null)
No description
Builder
scopeOrderByTranslation(Builder $query, string $orderField, string $orderType = 'ASC', string|null $locale = null)
No description
Builder
scopeOrderByRawByTranslation(Builder $query, string $orderRawString, string $groupByField, string|null $locale = null)
No description
bool
hasActiveTranslation(string|null $locale = null)
Checks if this model has active translations.
Collection
getActiveLanguages()
No description
Collection
translatedAttribute(string $key)
Returns all translations for a given attribute.
Details
string|null
getTranslationModelNameDefault()
Returns the fully qualified translation class name for this model.
Builder
scopeWithActiveTranslations(Builder $query, string|null $locale = null)
No description
Builder
scopeOrderByTranslation(Builder $query, string $orderField, string $orderType = 'ASC', string|null $locale = null)
No description
Builder
scopeOrderByRawByTranslation(Builder $query, string $orderRawString, string $groupByField, string|null $locale = null)
No description
bool
hasActiveTranslation(string|null $locale = null)
Checks if this model has active translations.
Collection
getActiveLanguages()
No description
Collection
translatedAttribute(string $key)
Returns all translations for a given attribute.