*/ public function toArray(Request $request): array { $locale = app()->getLocale(); return [ 'id' => $this->id, // Not translated: it is the name of a talk that was given once, in // one language. `language` says which. 'title' => $this->title, 'language' => $this->language, 'summary' => $this->getTranslation('summary', $locale, false) ?: null, 'event' => $this->event, 'city' => $this->city, 'held_at' => $this->held_at?->toDateString(), 'video_url' => $this->video_url, 'slides_url' => $this->slides_url, 'speaker' => PublicMemberResource::make($this->whenLoaded('member')), ]; } }