trait HasTranslation (View source)

Traits

Translatable

Methods

string|null
getTranslationModelNameDefault()

Returns the fully qualified translation class name for this model.

Builder|null
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.

Return Value

string|null

Builder|null scopeWithActiveTranslations(Builder $query, string|null $locale = null)

No description

Parameters

Builder $query
string|null $locale

Return Value

Builder|null

Builder scopeOrderByTranslation(Builder $query, string $orderField, string $orderType = 'ASC', string|null $locale = null)

No description

Parameters

Builder $query
string $orderField
string $orderType
string|null $locale

Return Value

Builder

Builder scopeOrderByRawByTranslation(Builder $query, string $orderRawString, string $groupByField, string|null $locale = null)

No description

Parameters

Builder $query
string $orderRawString
string $groupByField
string|null $locale

Return Value

Builder

bool hasActiveTranslation(string|null $locale = null)

Checks if this model has active translations.

Parameters

string|null $locale

Return Value

bool

Collection getActiveLanguages()

No description

Return Value

Collection

Collection translatedAttribute(string $key)

Returns all translations for a given attribute.

Parameters

string $key

Return Value

Collection