image)){ unlink(self::FILE_PATH.$item->image); } }); } public function translations() { return $this->hasMany(PostTranslation::class); } public function getTranslatedAttributes($localeId) { return $this->translations->where('localization_id', $localeId)->first(); } protected function title(): Attribute { return Attribute::make( get: fn ($value) => $this->translations->where('localization_id', session('locale_id'))->first()->title ); } }