locale = $locale; } public function transform(News $news) { return [ 'id' => $news->id, 'title' => $news->getTranslations('title', [$this->locale])[$this->locale] ?? '-', 'short_description' => $news->getTranslations('short_description', [$this->locale])[$this->locale] ?? '-', 'description' => $news->getTranslations('description', [$this->locale])[$this->locale] ?? '-', 'date' => $news->date, 'image' => url($news->image), ]; } }