orderBy($column, $order); return $query->select('seo_settings.*'); } public function translations() { return $this->hasMany(SeoSettingsTranslation::class); } public function getTranslation($languageId = null) { $languageId = $languageId ?: Language::where('code', request()->header('Content-Language') ?? app()->getLocale())->value('id'); return $this->translations->where('language_id', $languageId)->first(); } public function getTranslatedTitleAttribute() { return $this->getTranslation()?->title ?? $this->title; } public function getTranslatedDescriptionAttribute() { return $this->getTranslation()?->description ?? $this->description; } public function getTranslatedKeywordsAttribute() { return $this->getTranslation()?->keywords ?? $this->keywords; } }